<!DOCTYPE html><html lang="en"><head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
  <meta content="CR" name="w3c-status">
  <title>HTML 5.1: 2. Common infrastructure</title>
  <link href="styles/styles-html.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href=styles.default.css>
  <meta content="Bikeshed 1.0.0" name="generator">

  <link href="styles/W3C-CR" rel="stylesheet" type="text/css">
 </head>
 <body class="h-entry">
  <div class="head">
   <header>
    <p data-fill-with="logo"><a href="http://www.w3.org/"><img alt="W3C" height="48" src="styles/logos/W3C" width="72"></a></p>
    <h1 class="p-name no-ref allcaps" id="title">HTML 5.1</h1>
    <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">W3C Candidate Recommendation, <time class="dt-updated" datetime="2016-06-21">21 June 2016</time></span></h2>
   </header>
   
   
   
   
  </div>
  
  
  
  
  
  <nav data-fill-with="table-of-contents" id="toc"><p class="prev_next">← <a href="introduction.html#introduction"><span class="secno">1</span> <span class="content">Introduction</span></a> — <a href="index.html#contents">Table of contents</a> — <a href="dom.html#dom"><span class="secno">3</span> <span class="content">Semantics, structure, and APIs of HTML documents</span></a> →</p>
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory"><li>
     <a href="infrastructure.html#infrastructure"><span class="secno">2</span> <span class="content">Common infrastructure</span></a>
     <ol class="toc">
      <li>
       <a href="infrastructure.html#infrastructure-terminology"><span class="secno">2.1</span> <span class="content">Terminology</span></a>
       <ol class="toc">
        <li><a href="infrastructure.html#resources"><span class="secno">2.1.1</span> <span class="content">Resources</span></a>
        </li><li><a href="infrastructure.html#xml"><span class="secno">2.1.2</span> <span class="content">XML</span></a>
        </li><li><a href="infrastructure.html#dom-trees"><span class="secno">2.1.3</span> <span class="content">DOM trees</span></a>
        </li><li><a href="infrastructure.html#scripting"><span class="secno">2.1.4</span> <span class="content">Scripting</span></a>
        </li><li><a href="infrastructure.html#plugin-content-handlers"><span class="secno">2.1.5</span> <span class="content"><code>Plugin</code> Content Handlers</span></a>
        </li><li><a href="infrastructure.html#encoding-terminology"><span class="secno">2.1.6</span> <span class="content">Character encodings</span></a>
       </li></ol>
      </li><li>
       <a href="infrastructure.html#conformance-requirements"><span class="secno">2.2</span> <span class="content">Conformance requirements</span></a>
       <ol class="toc">
        <li><a href="infrastructure.html#conformance-classes"><span class="secno">2.2.1</span> <span class="content">Conformance classes</span></a>
        </li><li><a href="infrastructure.html#conformance-requirements-dependencies"><span class="secno">2.2.2</span> <span class="content">Dependencies</span></a>
        </li><li><a href="infrastructure.html#conformance-requirements-extensibility"><span class="secno">2.2.3</span> <span class="content">Extensibility</span></a>
        </li><li><a href="infrastructure.html#interactions-with-xpath-and-xslt"><span class="secno">2.2.4</span> <span class="content">Interactions with XPath and XSLT</span></a>
       </li></ol>
      </li><li><a href="infrastructure.html#case-sensitivity-and-string-comparison"><span class="secno">2.3</span> <span class="content">Case-sensitivity and string comparison</span></a>
      </li><li>
       <a href="infrastructure.html#common-microsyntaxes"><span class="secno">2.4</span> <span class="content">Common microsyntaxes</span></a>
       <ol class="toc">
        <li><a href="infrastructure.html#common-parser-idioms"><span class="secno">2.4.1</span> <span class="content">Common parser idioms</span></a>
        </li><li><a href="infrastructure.html#sec-boolean-attributes"><span class="secno">2.4.2</span> <span class="content">Boolean attributes</span></a>
        </li><li><a href="infrastructure.html#keywords-and-enumerated-attributes"><span class="secno">2.4.3</span> <span class="content">Keywords and enumerated attributes</span></a>
        </li><li>
         <a href="infrastructure.html#numbers"><span class="secno">2.4.4</span> <span class="content">Numbers</span></a>
         <ol class="toc">
          <li><a href="infrastructure.html#signed-integers"><span class="secno">2.4.4.1</span> <span class="content">Signed integers</span></a>
          </li><li><a href="infrastructure.html#non-negative-integers"><span class="secno">2.4.4.2</span> <span class="content">Non-negative integers</span></a>
          </li><li><a href="infrastructure.html#floating-point-numbers"><span class="secno">2.4.4.3</span> <span class="content">Floating-point numbers</span></a>
          </li><li><a href="infrastructure.html#percentages-and-dimensions"><span class="secno">2.4.4.4</span> <span class="content">Percentages and lengths</span></a>
          </li><li><a href="infrastructure.html#non-zero-percentages-and-lengths"><span class="secno">2.4.4.5</span> <span class="content">Non-zero percentages and lengths</span></a>
          </li><li><a href="infrastructure.html#lists-of-floating-point-numbers"><span class="secno">2.4.4.6</span> <span class="content">Lists of floating-point numbers</span></a>
          </li><li><a href="infrastructure.html#lists-of-dimensions"><span class="secno">2.4.4.7</span> <span class="content">Lists of dimensions</span></a>
         </li></ol>
        </li><li>
         <a href="infrastructure.html#dates-and-times"><span class="secno">2.4.5</span> <span class="content">Dates and times</span></a>
         <ol class="toc">
          <li><a href="infrastructure.html#months"><span class="secno">2.4.5.1</span> <span class="content">Months</span></a>
          </li><li><a href="infrastructure.html#sec-dates"><span class="secno">2.4.5.2</span> <span class="content">Dates</span></a>
          </li><li><a href="infrastructure.html#yearless-dates"><span class="secno">2.4.5.3</span> <span class="content">Yearless dates</span></a>
          </li><li><a href="infrastructure.html#times"><span class="secno">2.4.5.4</span> <span class="content">Times</span></a>
          </li><li><a href="infrastructure.html#floating-dates-and-times"><span class="secno">2.4.5.5</span> <span class="content">Floating dates and times</span></a>
          </li><li><a href="infrastructure.html#time-zones"><span class="secno">2.4.5.6</span> <span class="content">Time zones</span></a>
          </li><li><a href="infrastructure.html#global-dates-and-times"><span class="secno">2.4.5.7</span> <span class="content">Global dates and times</span></a>
          </li><li><a href="infrastructure.html#weeks"><span class="secno">2.4.5.8</span> <span class="content">Weeks</span></a>
          </li><li><a href="infrastructure.html#durations"><span class="secno">2.4.5.9</span> <span class="content">Durations</span></a>
          </li><li><a href="infrastructure.html#vaguer-moments-in-time"><span class="secno">2.4.5.10</span> <span class="content">Vaguer moments in time</span></a>
         </li></ol>
        </li><li><a href="infrastructure.html#colors"><span class="secno">2.4.6</span> <span class="content">Colors</span></a>
        </li><li><a href="infrastructure.html#space-separated-tokens"><span class="secno">2.4.7</span> <span class="content">Space-separated tokens</span></a>
        </li><li><a href="infrastructure.html#comma-separated-tokens"><span class="secno">2.4.8</span> <span class="content">Comma-separated tokens</span></a>
        </li><li><a href="infrastructure.html#syntax-references"><span class="secno">2.4.9</span> <span class="content">References</span></a>
        </li><li><a href="infrastructure.html#mq"><span class="secno">2.4.10</span> <span class="content">Media queries</span></a>
       </li></ol>
      </li><li>
       <a href="infrastructure.html#infrastructure-urls"><span class="secno">2.5</span> <span class="content">URLs</span></a>
       <ol class="toc">
        <li><a href="infrastructure.html#urls-terminology"><span class="secno">2.5.1</span> <span class="content">Terminology</span></a>
        </li><li><a href="infrastructure.html#parsing-urls"><span class="secno">2.5.2</span> <span class="content">Parsing URLs</span></a>
        </li><li><a href="infrastructure.html#dynamic-changes-to-base-urls"><span class="secno">2.5.3</span> <span class="content">Dynamic changes to base URLs</span></a>
       </li></ol>
      </li><li>
       <a href="infrastructure.html#fetching-resources"><span class="secno">2.6</span> <span class="content">Fetching resources</span></a>
       <ol class="toc">
        <li><a href="infrastructure.html#fetching-resources-terminology"><span class="secno">2.6.1</span> <span class="content">Terminology</span></a>
        </li><li><a href="infrastructure.html#fetching-resources-processing-model"><span class="secno">2.6.2</span> <span class="content">Processing model</span></a>
        </li><li><a href="infrastructure.html#encrypted-http-and-related-security-concerns"><span class="secno">2.6.3</span> <span class="content">Encrypted HTTP and related security concerns</span></a>
        </li><li><a href="infrastructure.html#content-type-sniffing"><span class="secno">2.6.4</span> <span class="content">Determining the type of a resource</span></a>
        </li><li><a href="infrastructure.html#extracting-character-encodings-from-meta-elements"><span class="secno">2.6.5</span> <span class="content">Extracting character encodings from <code><span>meta</span></code> elements</span></a>
        </li><li><a href="infrastructure.html#cors-settings-attributes"><span class="secno">2.6.6</span> <span class="content">CORS settings attributes</span></a>
       </li></ol>
      </li><li>
       <a href="infrastructure.html#common-dom-interfaces"><span class="secno">2.7</span> <span class="content">Common DOM interfaces</span></a>
       <ol class="toc">
        <li><a href="infrastructure.html#reflecting-content-attributes-in-idl-attributes"><span class="secno">2.7.1</span> <span class="content">Reflecting content attributes in IDL attributes</span></a>
        </li><li>
         <a href="infrastructure.html#collections"><span class="secno">2.7.2</span> <span class="content">Collections</span></a>
         <ol class="toc">
          <li><a href="infrastructure.html#the-htmlallcollection-interface"><span class="secno">2.7.2.1</span> <span class="content">The <code>HTMLAllCollection</code> interface</span></a>
          </li><li><a href="infrastructure.html#the-htmlformcontrolscollection-interface"><span class="secno">2.7.2.2</span> <span class="content">The <code>HTMLFormControlsCollection</code> interface</span></a>
          </li><li><a href="infrastructure.html#the-htmloptionscollection-interface"><span class="secno">2.7.2.3</span> <span class="content">The <code>HTMLOptionsCollection</code> interface</span></a>
         </li></ol>
        </li><li><a href="infrastructure.html#the-domstringmap-interface"><span class="secno">2.7.3</span> <span class="content">The <code>DOMStringMap</code> interface</span></a>
        </li><li><a href="infrastructure.html#the-domelementmap-interface"><span class="secno">2.7.4</span> <span class="content">The <code>DOMElementMap</code> interface</span></a>
        </li><li><a href="infrastructure.html#garbage-collection"><span class="secno">2.7.5</span> <span class="content">Garbage collection</span></a>
       </li></ol>
      </li><li><a href="infrastructure.html#namespaces"><span class="secno">2.8</span> <span class="content">Namespaces</span></a>
      </li><li>
       <a href="infrastructure.html#safe-passing-of-structured-data"><span class="secno">2.9</span> <span class="content">Safe passing of structured data</span></a>
       <ol class="toc">
        <li><a href="infrastructure.html#section-cloneable-objects"><span class="secno">2.9.1</span> <span class="content"><span>Cloneable objects</span></span></a>
        </li><li><a href="infrastructure.html#section-transferable-objects"><span class="secno">2.9.2</span> <span class="content"><span>Transferable objects</span></span></a>
        </li><li><a href="infrastructure.html#section-structuredclonewithtransfer"><span class="secno">2.9.3</span> <span class="content"><span>StructuredCloneWithTransfer</span> ( <var>input</var>, <var>transferList</var>, <var>targetRealm</var> )</span></a>
        </li><li><a href="infrastructure.html#section-structuredclone"><span class="secno">2.9.4</span> <span class="content"><span>StructuredClone</span> ( <var>input</var>, <var>targetRealm</var> [ , <var>memory</var> ] )</span></a>
        </li><li><a href="infrastructure.html#section-idistransferable"><span class="secno">2.9.5</span> <span class="content"><span>IsTransferable</span> ( <var>O</var> )</span></a>
        </li><li><a href="infrastructure.html#section-transferhelper"><span class="secno">2.9.6</span> <span class="content"><span>TransferHelper</span> ( <var>input</var>, <var>targetRealm</var> )</span></a>
       </li></ol>
     </li></ol>
    </li></ol>
  </nav><main><section>
    <h2 class="heading settled" data-level="2" id="infrastructure"><span class="secno">2. </span><span class="content">Common infrastructure</span><a class="self-link" href="infrastructure.html#infrastructure"></a></h2>
    <h3 class="heading settled" data-level="2.1" id="infrastructure-terminology"><span class="secno">2.1. </span><span class="content">Terminology</span><a class="self-link" href="infrastructure.html#infrastructure-terminology"></a></h3>
    <p>This specification refers to both HTML and XML attributes and IDL attributes, often in the same
  context. When it is not clear which is being referred to, they are referred to as <a data-link-type="dfn" href="dom.html#content-attribute" id="ref-for-content-attribute-1">content attributes</a> for HTML and XML attributes, and <dfn data-dfn-type="dfn" data-lt="IDL attribute|IDL attributes" data-noexport="" id="idl-attribute">IDL attributes<a class="self-link" href="infrastructure.html#idl-attribute"></a></dfn> for those
  defined on IDL interfaces. Similarly, the term "properties" is used for both JavaScript object
  properties and CSS properties. When these are ambiguous they are qualified as <dfn data-dfn-type="dfn" data-lt="object property|object properties" data-noexport="" id="object-property">object properties<a class="self-link" href="infrastructure.html#object-property"></a></dfn> and <dfn data-dfn-type="dfn" data-lt="CSS property|CSS properties" data-noexport="" id="css-property">CSS properties<a class="self-link" href="infrastructure.html#css-property"></a></dfn> respectively.</p>
    <p>Generally, when the specification states that a feature applies to <a href="syntax.html#syntax">the HTML syntax</a> or <a href="xhtml.html#xhtml">the XHTML syntax</a>, it also includes the other. When a feature specifically only applies to
  one of the two languages, it is called out by explicitly stating that it does not apply to the
  other format, as in "for HTML, ... (this does not apply to XHTML)".</p>
    <p>This specification uses the term <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="document|documents" data-noexport="" id="document">document</dfn> to refer to any use of HTML, ranging from
  short static documents to long essays or reports with rich multimedia, as well as to fully-fledged
  interactive applications. The term is used to refer both to <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> objects and
  their descendant DOM trees, and to serialized byte streams using the <a href="syntax.html#syntax">HTML syntax</a> or <a href="xhtml.html#xhtml">XHTML syntax</a>, depending on context.</p>
    <p>In the context of the DOM structures, the terms <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="html-document">HTML document</dfn> and <a data-link-type="dfn" href="infrastructure.html#xml-document" id="ref-for-xml-document-1">XML document</a> are
  used as defined in the DOM specification, and refer specifically to two different modes that <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> objects can find themselves in. <a data-link-type="biblio" href="references.html#biblio-dom">[DOM]</a> (Such uses are always hyperlinked
  to their definition.)</p>
    <p>In the context of byte streams, the term <a data-link-type="dfn" href="infrastructure.html#html-document" id="ref-for-html-document-1">HTML document</a> refers to resources labeled as <a href="iana.html#text-html"><code>text/html</code></a>, and the term <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="xml-document">XML document</dfn> refers to resources labeled with an <a data-link-type="dfn" href="infrastructure.html#xml-mime-type" id="ref-for-xml-mime-type-2">XML MIME type</a>.</p>
    <p>The term <dfn data-dfn-type="dfn" data-lt="XHTML document|XHTML documents" data-noexport="" id="xhtml-document">XHTML document<a class="self-link" href="infrastructure.html#xhtml-document"></a></dfn> is used to refer to both <a data-link-type="dfn" href="infrastructure.html#document" id="ref-for-document-1">documents</a> in the <a data-link-type="dfn" href="infrastructure.html#xml-document" id="ref-for-xml-document-2">XML document</a> mode that contain element nodes in the <a data-link-type="dfn" href="infrastructure.html#html-namespace" id="ref-for-html-namespace-1">HTML namespace</a>, and byte
  streams labeled with an <a data-link-type="dfn" href="infrastructure.html#xml-mime-type" id="ref-for-xml-mime-type-3">XML MIME type</a> that contain elements from the <a data-link-type="dfn" href="infrastructure.html#html-namespace" id="ref-for-html-namespace-2">HTML namespace</a>,
  depending on context.</p>
    <hr>
    <p>For simplicity, terms such as <dfn data-dfn-type="dfn" data-noexport="" id="shown">shown<a class="self-link" href="infrastructure.html#shown"></a></dfn>, <dfn data-dfn-type="dfn" data-noexport="" id="displayed">displayed<a class="self-link" href="infrastructure.html#displayed"></a></dfn>, and <dfn data-dfn-type="dfn" data-noexport="" id="visible">visible<a class="self-link" href="infrastructure.html#visible"></a></dfn> are
  used (sometimes) when referring to the way a document is rendered to the user. These terms are
  not meant to imply a visual medium; they must be considered to apply to other media in equivalent
  ways.</p>
    <p>When an algorithm B says to return to another algorithm A, it implies that A called B. Upon
  returning to A, the implementation must continue from where it left off in calling B. Some
  algorithms run <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="in-parallel">in parallel</dfn>; this means that the algorithm’s subsequent steps are to be
  run, one after another, at the same time as other logic in the specification (e.g., at the same
  time as the <a data-link-type="dfn" href="webappapis.html#event-loop" id="ref-for-event-loop-1">event loop</a>). This specification does not define the precise mechanism by which
  this is achieved, be it time-sharing cooperative multitasking, fibers, threads, processes, using
  different hyperthreads, cores, CPUs, machines, etc. By contrast, an operation that is to run <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="immediately">immediately</dfn> must interrupt the currently running task, run itself, and then resume the
  previously running task.</p>
    <p>The term "transparent black" refers to the color with red, green, blue, and alpha channels all set
  to zero.</p>
    <h4 class="heading settled" data-level="2.1.1" id="resources"><span class="secno">2.1.1. </span><span class="content">Resources</span><a class="self-link" href="infrastructure.html#resources"></a></h4>
    <p>The specification uses the term <dfn data-dfn-type="dfn" data-noexport="" id="supported">supported<a class="self-link" href="infrastructure.html#supported"></a></dfn> when referring to whether a user agent has an
  implementation capable of decoding the semantics of an external resource. A format or type is said
  to be <i>supported</i> if the implementation can process an external resource of that format or
  type without critical aspects of the resource being ignored. Whether a specific resource is <i>supported</i> can depend on what features of the resource’s format are in use.</p>
    <p class="example" id="example-edb32f0b"><a class="self-link" href="infrastructure.html#example-edb32f0b"></a> For example, a PNG image would be considered to be in a supported format if its pixel data could
    be decoded and rendered, even if, unbeknownst to the implementation, the image also contained
    animation data. </p>
    <p class="example" id="example-fda82d15"><a class="self-link" href="infrastructure.html#example-fda82d15"></a> An MPEG-4 video file would not be considered to be in a supported format if the compression
    format used was not supported, even if the implementation could determine the dimensions of the
    movie from the file’s metadata. </p>
    <p>What some specifications, in particular the HTTP specification, refer to as a <i>representation</i> is referred to in this specification as a <dfn class="dfn-paneled" data-dfn-for="http" data-dfn-type="dfn" data-noexport="" id="http-resource">resource</dfn>. <a data-link-type="biblio" href="references.html#biblio-http">[HTTP]</a></p>
    <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="mime type|mime types" data-noexport="" id="mime-type">MIME type</dfn> is used to refer to what is sometimes called an <i>Internet media
  type</i> in protocol literature. The term <dfn data-dfn-for="media type|media-type" data-dfn-type="dfn" data-noexport="" id="media-typemedia-type-media-type">media type<a class="self-link" href="infrastructure.html#media-typemedia-type-media-type"></a></dfn> in this specification is used to refer
  to the type of media intended for presentation, as used by the CSS specifications. <a data-link-type="biblio" href="references.html#biblio-rfc2046">[RFC2046]</a> <a data-link-type="biblio" href="references.html#biblio-mediaq">[MEDIAQ]</a></p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-mime-type">valid MIME type</dfn> if it matches the <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7231#section-3.1.1.1"><code>media-type</code></a> rule. In particular, a <a data-link-type="dfn" href="infrastructure.html#valid-mime-type" id="ref-for-valid-mime-type-1">valid mime type</a> may include
  MIME type parameters. <a data-link-type="biblio" href="references.html#biblio-http">[HTTP]</a></p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-for="mime type" data-dfn-type="dfn" data-lt="valid MIME type with no parameters|valid MIME types with no parameters" data-noexport="" id="mime-type-valid-mime-type-with-no-parameters">valid MIME type with no parameters</dfn> if it matches the <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7231#section-3.1.1.1"><code>media-type</code></a> rule, but does not
  contain any U+003B SEMICOLON characters (;). In other words, if it consists only of a type and
  subtype, with no MIME Type parameters. <a data-link-type="biblio" href="references.html#biblio-http">[HTTP]</a></p>
    <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="html-mime-type">HTML MIME type</dfn> is used to refer to the <a data-link-type="dfn" href="infrastructure.html#mime-type" id="ref-for-mime-type-2">MIME type</a> <a href="iana.html#text-html"><code>text/html</code></a>.</p>
    <p>A resource’s <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="critical subresource|critical subresources" data-noexport="" id="critical-subresource">critical subresources</dfn> are those that the resource needs to have available
  to be correctly processed. Which resources are considered critical or not is defined by the
  specification that defines the resource’s format.</p>
    <p>The term <a data-link-type="scheme" href="infrastructure.html#schemedef-data-url" id="ref-for-schemedef-data-url-1"><code>data:</code> URL</a> refers to <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URLs</a> that use the <a data-link-type="scheme" href="infrastructure.html#schemedef-data-url" id="ref-for-schemedef-data-url-2"><code>data:</code></a> scheme. <a data-link-type="biblio" href="references.html#biblio-rfc2397">[RFC2397]</a></p>
    <h4 class="heading settled" data-level="2.1.2" id="xml"><span class="secno">2.1.2. </span><span class="content">XML</span><a class="self-link" href="infrastructure.html#xml"></a></h4>
    <p>To ease migration from HTML to XHTML, user agents conforming to this specification will place elements in
  HTML in the <code>https://www.w3.org/1999/xhtml</code> namespace, at least for the purposes of the
  DOM and CSS. The term "<dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="html element|html elements" data-noexport="" id="html-element">HTML elements</dfn>", when used in this specification, refers to any
  element in that namespace, and thus refers to both HTML and XHTML elements.</p>
    <p>Except where otherwise stated, all elements defined or mentioned in this specification are in the <a data-link-type="dfn" href="infrastructure.html#html-namespace" id="ref-for-html-namespace-3">HTML namespace</a> ("<code>https://www.w3.org/1999/xhtml</code>"), and all attributes defined or
  mentioned in this specification have no namespace.</p>
    <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="element-type">element type</dfn> is used to refer to the set of elements that have a given local
  name and namespace. For example, <code><a data-link-type="element" href="sec-forms.html#elementdef-button" id="ref-for-elementdef-button-2">button</a></code> elements are elements with the element type <code><a data-link-type="element" href="sec-forms.html#elementdef-button" id="ref-for-elementdef-button-3">button</a></code>, meaning they have the local name "<code><a data-link-type="element" href="sec-forms.html#elementdef-button" id="ref-for-elementdef-button-4">button</a></code>" and (implicitly as
  defined above) the <a data-link-type="dfn" href="infrastructure.html#html-namespace" id="ref-for-html-namespace-4">HTML namespace</a>.</p>
    <p>Attribute names are said to be <dfn class="dfn-paneled" data-dfn-for="xml-compatible" data-dfn-type="dfn" data-noexport="" id="xml-compatible-xml-compatible">XML-compatible</dfn> if they match the <a data-link-type="dfn" href="https://www.w3.org/TR/xml/#NT-Name"><code>Name</code></a> production defined in XML and they contain no U+003A COLON characters
  (:). <a data-link-type="biblio" href="references.html#biblio-xml">[XML]</a></p>
    <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="xml-mime-type">XML MIME type</dfn> is used to refer to the <a data-link-type="dfn" href="infrastructure.html#mime-type" id="ref-for-mime-type-3">MIME types</a> <code>text/xml</code>, <code>application/xml</code>, and any <a data-link-type="dfn" href="infrastructure.html#mime-type" id="ref-for-mime-type-4">MIME type</a> whose subtype ends with the four characters
  "<code>+xml</code>". <a data-link-type="biblio" href="references.html#biblio-rfc7303">[RFC7303]</a></p>
    <h4 class="heading settled" data-level="2.1.3" id="dom-trees"><span class="secno">2.1.3. </span><span class="content">DOM trees</span><a class="self-link" href="infrastructure.html#dom-trees"></a></h4>
    <p>The <dfn class="dfn-paneled" data-dfn-for="document" data-dfn-type="dfn" data-noexport="" id="document-root-element-of-a-document-object">root element of a <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> object</dfn> is that <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code>'s
  first element child, if any. If it does not have one then the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> has no root
  element.</p>
    <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="root element|root elements" data-noexport="" id="root-element">root element</dfn>, when not referring to a <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> object’s root
  element, means the furthest ancestor element node of whatever node is being discussed, or the node
  itself if it has no ancestors. When the node is a part of the document, then the node’s <a data-link-type="dfn" href="infrastructure.html#root-element" id="ref-for-root-element-2">root element</a> is indeed the document’s root element; however, if the node is not currently
  part of the document tree, the root element will be an orphaned node.</p>
    <p>When an element’s <a data-link-type="dfn" href="infrastructure.html#root-element" id="ref-for-root-element-3">root element</a> is the <a data-link-type="dfn" href="infrastructure.html#document-root-element-of-a-document-object" id="ref-for-document-root-element-of-a-document-object-1">root element of a <code>Document</code> object</a>,
  it is said to be <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="in the document|in a document" data-noexport="" id="in-the-document">in a <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code></dfn>. An element is said to have been <dfn class="dfn-paneled" data-dfn-for="document" data-dfn-type="dfn" data-lt="inserted into the document|inserted into a document|inserted into" data-noexport="" id="document-inserted-into-the-document">inserted into a document</dfn> when its <a data-link-type="dfn" href="infrastructure.html#root-element" id="ref-for-root-element-4">root element</a> changes and is now the document’s <a data-link-type="dfn" href="infrastructure.html#root-element" id="ref-for-root-element-5">root element</a>. Analogously, an element is said to have been <dfn class="dfn-paneled" data-dfn-for="document" data-dfn-type="dfn" data-lt="removed from a document|removed from" data-noexport="" id="document-removed-from-a-document">removed from a document</dfn> when its <a data-link-type="dfn" href="infrastructure.html#root-element" id="ref-for-root-element-6">root element</a> changes from being the document’s <a data-link-type="dfn" href="infrastructure.html#root-element" id="ref-for-root-element-7">root element</a> to being another element.</p>
    <p>A node’s <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="home subtree|home subtrees" data-noexport="" id="home-subtree">home subtree</dfn> is the subtree rooted at that node’s <a data-link-type="dfn" href="infrastructure.html#root-element" id="ref-for-root-element-8">root element</a>. When a
  node is <a data-link-type="dfn" href="infrastructure.html#in-the-document" id="ref-for-in-the-document-1">in a <code>Document</code></a>, its <a data-link-type="dfn" href="infrastructure.html#home-subtree" id="ref-for-home-subtree-1">home subtree</a> is that <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code>'s tree.</p>
    <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> of a <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#node">Node</a></code> (such as an element) is the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> that the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#node">Node</a></code>'s <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-node-ownerdocument">ownerDocument</a></code> IDL attribute returns. When a <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#node">Node</a></code> is <a data-link-type="dfn" href="infrastructure.html#in-the-document" id="ref-for-in-the-document-2">in a <code>Document</code></a> then that <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> is
  always the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#node">Node</a></code>'s <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code>, and the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#node">Node</a></code>'s <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-node-ownerdocument">ownerDocument</a></code> IDL attribute thus always returns that <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code>.</p>
    <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> of a content attribute is the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> of the attribute’s
  element.</p>
    <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="tree-order">tree order</dfn> means a pre-order, depth-first traversal of DOM nodes involved
  (through the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-node-parentnode">parentNode</a></code>/<code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-node-childnodes">childNodes</a></code> relationship).</p>
    <p>When it is stated that some element or attribute is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="ignored">ignored</dfn>, or treated as some other
  value, or handled as if it was something else, this refers only to the processing of the node
  after it is in the DOM. A user agent must not mutate the DOM in such situations.</p>
    <p>A content attribute is said to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="change">change</dfn> value only if its new value is different than its
  previous value; setting an attribute to a value it already has does not change it.</p>
    <p>When an attribute value, <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#text">Text</a></code> node, or string is described as <dfn data-dfn-type="dfn" data-noexport="" id="empty">empty<a class="self-link" href="infrastructure.html#empty"></a></dfn>, it means that the length of the text is zero (i.e., not even containing spaces or <a data-link-type="dfn" href="infrastructure.html#control-characters" id="ref-for-control-characters-1">control characters</a>).</p>
    <p>An element’s <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="child-text-content">child text content</dfn> is the concatenation of the <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-cd-data">data</a> of all the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#text">Text</a></code> nodes that are children of the element (ignoring any other nodes such as comments or
  elements), in <a data-link-type="dfn" href="infrastructure.html#tree-order" id="ref-for-tree-order-1">tree order</a>.</p>
    <p>A <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-insert">node <var>A</var> is
  inserted</a> into a node <var>B</var> when the <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-insert-ext">insertion steps</a> are invoked with <var>A</var> as the argument and <var>A</var>’s new parent
  is <var>B</var>. Similarly, a <dfn data-dfn-type="dfn" data-noexport="" id="node-a-is-removed">node <var>A</var> is removed<a class="self-link" href="infrastructure.html#node-a-is-removed"></a></dfn> from a node <var>B</var> when the <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-remove-ext">removing steps</a> are invoked with <var>A</var> as the <var>removedNode</var> argument and <var>B</var> as the <var>oldParent</var> argument.</p>
    <h4 class="heading settled" data-level="2.1.4" id="scripting"><span class="secno">2.1.4. </span><span class="content">Scripting</span><a class="self-link" href="infrastructure.html#scripting"></a></h4>
    <p>The construction "a <code>Foo</code> object", where <code>Foo</code> is actually an interface,
  is sometimes used instead of the more accurate "an object implementing the interface <code>Foo</code>".</p>
    <p>An IDL attribute is said to be <dfn data-dfn-for="values" data-dfn-type="dfn" data-noexport="" id="values-getting">getting<a class="self-link" href="infrastructure.html#values-getting"></a></dfn> when its value is being retrieved
  (e.g., by author script), and is said to be <dfn class="dfn-paneled" data-dfn-for="values" data-dfn-type="dfn" data-noexport="" id="values-setting">setting</dfn> when a new value is
  assigned to it.</p>
    <p>If a DOM object is said to be <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="live">live</dfn>, then the attributes and methods on that object
  must operate on the actual underlying data, not a snapshot of the data.</p>
    <p>In the contexts of events, the terms <i>fire</i> and <i>dispatch</i> are used as defined in the
  DOM specification: <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="fire|firing|fired|fires|fire a simple event|fires a simple event" data-noexport="" id="fire">firing</dfn> an event means to create and <a data-link-type="dfn" href="infrastructure.html#dispatch" id="ref-for-dispatch-1">dispatch</a> it, and <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="dispatch|dispatching|dispatched|dom event dispatch logic|event dispatching" data-noexport="" id="dispatch">dispatching</dfn> an event means to follow the steps that propagate the event through the
  tree. The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="trusted|trusted event" data-noexport="" id="trusted">trusted event</dfn> is used to refer to events whose <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-event-istrusted">isTrusted</a></code> attribute is initialized to true. <a data-link-type="biblio" href="references.html#biblio-dom">[DOM]</a></p>
    <h4 class="heading settled" data-level="2.1.5" id="plugin-content-handlers"><span class="secno">2.1.5. </span><span class="content"><code>Plugin</code> Content Handlers</span><a class="self-link" href="infrastructure.html#plugin-content-handlers"></a></h4>
    <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="plugin|plugins" data-noexport="" id="plugin">plugin</dfn> refers to a user-agent defined set of content
  handlers that can be used by the user agent. The content handlers can take part in the user
  agent’s rendering of a <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> object, but that neither act as <a data-link-type="dfn" href="browsers.html#child-browsing-context" id="ref-for-child-browsing-context-1">child browsing contexts</a> of the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> nor introduce any <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#node">Node</a></code> objects to the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code>'s DOM.</p>
    <p>Typically such content handlers are provided by third parties, though a user agent can also
  designate built-in content handlers as <a data-link-type="dfn" href="infrastructure.html#plugin" id="ref-for-plugin-2">plugins</a>.</p>
    <p>A user agent must not consider the types <code>text/plain</code> and <code>application/octet-stream</code> as having a registered <a data-link-type="dfn" href="infrastructure.html#plugin" id="ref-for-plugin-3">plugin</a>.</p>
    <p class="example" id="example-a319674c"><a class="self-link" href="infrastructure.html#example-a319674c"></a> One example of a plugin would be a PDF viewer that is instantiated in a <a data-link-type="dfn" href="browsers.html#browsing-context" id="ref-for-browsing-context-2">browsing context</a> when the user navigates to a PDF file. This would count as a
    plugin regardless of whether the party that implemented the PDF viewer component was the same as
    that which implemented the user agent itself. However, a PDF viewer application that launches
    separate from the user agent (as opposed to using the same interface) is not a plugin by this
    definition. </p>
    <p class="note" role="note"> This specification does not define a mechanism for interacting with <a data-link-type="dfn" href="infrastructure.html#plugin" id="ref-for-plugin-4">plugins</a>, as it is expected
    to be user-agent- and platform-specific. Some user agents might opt to support a plugin mechanism such
    as the Netscape Plugin API; others might use remote content converters or have built-in support
    for certain types. Indeed, this specification doesn’t require user agents to support <a data-link-type="dfn" href="infrastructure.html#plugin" id="ref-for-plugin-5">plugins</a> at
    all. <a data-link-type="biblio" href="references.html#biblio-npapi">[NPAPI]</a> </p>
    <p>A plugin can be <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="secured">secured</dfn> if it honors the semantics of the <code><a data-link-type="element-sub" href="semantics-embedded-content.html#element-attrdef-iframe-sandbox" id="ref-for-element-attrdef-iframe-sandbox-1">sandbox</a></code> attribute.</p>
    <p class="example" id="example-438a40c4"><a class="self-link" href="infrastructure.html#example-438a40c4"></a> For example, a secured plugin would prevent its contents from creating pop-up windows when the
    plugin is instantiated inside a sandboxed <code><a data-link-type="element" href="semantics-embedded-content.html#elementdef-iframe" id="ref-for-elementdef-iframe-3">iframe</a></code>. </p>
    <p class="warning"> Browsers should take extreme care when interacting with external content intended for <a data-link-type="dfn" href="infrastructure.html#plugin" id="ref-for-plugin-6">plugins</a>. When third-party software is run with the same privileges as the user agent
    itself, vulnerabilities in the third-party software become as dangerous as if they were
    vulnerabilities of the user agent itself. </p>
    <p>Since different users having different sets of <a data-link-type="dfn" href="infrastructure.html#plugin" id="ref-for-plugin-7">plugins</a> provides a fingerprinting vector
  that increases the chances of users being uniquely identified, user agents are encouraged to
  support the exact same set of <a data-link-type="dfn" href="infrastructure.html#plugin" id="ref-for-plugin-8">plugins</a> for each user. <a class="fingerprint" href="introduction.html#fingerprinting-vector" id="ref-for-fingerprinting-vector-2"><img alt="(This is a fingerprinting vector.)" height="21" src="images/fingerprint.png" width="15"></a></p>
    <h4 class="heading settled" data-level="2.1.6" id="encoding-terminology"><span class="secno">2.1.6. </span><span class="content">Character encodings</span><a class="self-link" href="infrastructure.html#encoding-terminology"></a></h4>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="character-encoding">character encoding</dfn>, or just <i>encoding</i> where that is not ambiguous, is a defined way to convert between byte streams and
  Unicode strings, as defined in the WHATWG Encoding standard. An <a data-link-type="dfn" href="https://www.w3.org/TR/encoding/#encoding">encoding</a> has an <dfn data-dfn-type="dfn" data-noexport="" id="encoding-name">encoding name<a class="self-link" href="infrastructure.html#encoding-name"></a></dfn> and one or more <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="encoding-labels">encoding labels</dfn>, referred to as the
  encoding’s <i>name</i> and <i>labels</i> in the Encoding standard. <a data-link-type="biblio" href="references.html#biblio-encoding">[ENCODING]</a></p>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="utf-16-encoding">UTF-16 encoding</dfn> is <a data-link-type="dfn" href="syntax.html#utf-16be" id="ref-for-utf-16be-1">UTF-16BE</a> or <a data-link-type="dfn" href="syntax.html#utf-16le" id="ref-for-utf-16le-1">UTF-16LE</a>. <a data-link-type="biblio" href="references.html#biblio-encoding">[ENCODING]</a></p>
    <p>An <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="ascii-compatible-encoding">ASCII-compatible encoding</dfn> is any <a data-link-type="dfn" href="https://www.w3.org/TR/encoding/#encoding">encoding</a> that is not a <a data-link-type="dfn" href="infrastructure.html#utf-16-encoding" id="ref-for-utf-16-encoding-1">UTF-16 encoding</a>. <a data-link-type="biblio" href="references.html#biblio-encoding">[ENCODING]</a></p>
    <p class="note" role="note"> Since support for encodings that are not defined in the WHATWG Encoding standard is prohibited, <a data-link-type="dfn" href="infrastructure.html#utf-16-encoding" id="ref-for-utf-16-encoding-2">UTF-16 encodings</a> are the only encodings that this specification needs to treat as not
    being <a data-link-type="dfn" href="infrastructure.html#ascii-compatible-encoding" id="ref-for-ascii-compatible-encoding-1">ASCII-compatible encodings</a>. </p>
    <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="code-unit">code unit</dfn> is used as defined in the Web IDL specification: a 16 bit unsigned
  integer, the smallest atomic component of a <code>DOMString</code>. (This is a narrower definition
  than the one used in Unicode, and is not the same as a <i>code point</i>.) <a data-link-type="biblio" href="references.html#biblio-webidl">[WEBIDL]</a></p>
    <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="unicode-code-point">Unicode code point</dfn> means a <i>Unicode scalar value</i> where possible, and an
  isolated surrogate code point when not. When a conformance requirement is defined in terms of
  characters or Unicode code points, a pair of <a data-link-type="dfn" href="infrastructure.html#code-unit" id="ref-for-code-unit-1">code units</a> consisting of a high surrogate
  followed by a low surrogate must be treated as the single code point represented by the surrogate
  pair, but isolated surrogates must each be treated as the single code point with the value of the
  surrogate. <a data-link-type="biblio" href="references.html#biblio-unicode">[UNICODE]</a></p>
    <p>In this specification, the term <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="character">character</dfn>, when not qualified as <em>Unicode</em> character, is synonymous with the term <a data-link-type="dfn" href="infrastructure.html#unicode-code-point" id="ref-for-unicode-code-point-1">Unicode code point</a>.</p>
    <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="unicode-character">Unicode character</dfn> is used to mean a <i>Unicode scalar value</i> (i.e. any
  Unicode code point that is not a surrogate code point). <a data-link-type="biblio" href="references.html#biblio-unicode">[UNICODE]</a></p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="code-unit-length">code-unit length</dfn> of a string is the number of <a data-link-type="dfn" href="infrastructure.html#code-unit" id="ref-for-code-unit-2">code units</a> in that string.</p>
    <p class="note" role="note"> This complexity results from the historical decision to define the DOM API in terms of 16 bit
    (UTF-16) <a data-link-type="dfn" href="infrastructure.html#code-unit" id="ref-for-code-unit-3">code units</a>, rather than in terms of <a data-link-type="dfn" href="infrastructure.html#unicode-character" id="ref-for-unicode-character-1">Unicode characters</a>. </p>
    <h3 class="heading settled" data-level="2.2" id="conformance-requirements"><span class="secno">2.2. </span><span class="content">Conformance requirements</span><a class="self-link" href="infrastructure.html#conformance-requirements"></a></h3>
    <p>All diagrams, examples, and notes in this specification are non-normative, as are all sections
  explicitly marked non-normative. Everything else in this specification is normative.</p>
    <p>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
  "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this document
  are to be interpreted as described in RFC2119. The key word "OPTIONALLY" in the normative parts of
  this document is to be interpreted with the same normative meaning as "MAY" and "OPTIONAL". For
  readability, these words do not appear in all uppercase letters in this specification. <a data-link-type="biblio" href="references.html#biblio-rfc2119">[RFC2119]</a></p>
    <p>Requirements phrased in the imperative as part of algorithms (such as "strip any leading space
  characters" or "return false and abort these steps") are to be interpreted with the meaning of
  the key word ("must", "should", "may", etc) used in introducing the algorithm.</p>
    <div class="example" id="example-d0f0c06d">
     <a class="self-link" href="infrastructure.html#example-d0f0c06d"></a> For example, were the spec to say: 
<pre>To eat an orange, the user must:
1. Peel the orange.
2. Separate each slice of the orange.
3. Eat the orange slices.
</pre>
     <p>...it would be equivalent to the following:</p>
<pre>To eat an orange:
1. The user must peel the orange.
2. The user must separate each slice of the orange.
3. The user must eat the orange slices.
</pre>
     <p>Here the key word is "must".</p>
     <p>The former (imperative) style is generally preferred in this specification for stylistic
    reasons.</p>
    </div>
    <p>Conformance requirements phrased as algorithms or specific steps may be implemented in any
  manner, so long as the end result is equivalent. (In particular, the algorithms defined in this
  specification are intended to be easy to follow, and not intended to be performant.)</p>
    <h4 class="heading settled" data-level="2.2.1" id="conformance-classes"><span class="secno">2.2.1. </span><span class="content">Conformance classes</span><a class="self-link" href="infrastructure.html#conformance-classes"></a></h4>
    <p>This specification describes the conformance criteria for user agents (relevant
  to implementors) and documents (relevant to authors and authoring tool
  implementors).</p>
    <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="conforming document|conforming documents" data-noexport="" id="conforming-document">Conforming documents</dfn> are those that comply with all the conformance criteria for
  documents. For readability, some of these conformance requirements are phrased as conformance
  requirements on authors; such requirements are implicitly requirements on documents: by
  definition, all documents are assumed to have had an author. (In some cases, that author may
  itself be a user agent — such user agents are subject to additional rules, as explained
  below.)</p>
    <p class="example" id="example-cf97d5a1"><a class="self-link" href="infrastructure.html#example-cf97d5a1"></a> For example, if a requirement states that "authors must not use the <code>foobar</code> element", it would imply that documents are not allowed to contain elements named <code>foobar</code>. </p>
    <p class="note impl" role="note"> There is no implied relationship between document conformance requirements and implementation
    conformance requirements. User agents are not free to handle non-conformant documents as they
    please; the processing model described in this specification applies to implementations
    regardless of the conformity of the input documents. </p>
    <p>User agents fall into several (overlapping) categories with different conformance requirements.</p>
    <dl>
     <dt data-md="">
      <p>Web browsers and other interactive user agents</p>
     </dt><dd data-md="">
      <p>Web browsers that support <a href="xhtml.html#xhtml">the XHTML syntax</a> must process elements and attributes from the <a data-link-type="dfn" href="infrastructure.html#html-namespace" id="ref-for-html-namespace-5">HTML namespace</a> found in XML documents as described in this specification, so that users
  can interact with them, unless the semantics of those elements have been overridden by other
  specifications.</p>
      <p class="example" id="example-0023f092"><a class="self-link" href="infrastructure.html#example-0023f092"></a> A conforming XHTML processor would, upon finding an XHTML <code><a data-link-type="element" href="semantics-scripting.html#elementdef-script" id="ref-for-elementdef-script-6">script</a></code> element in an
    XML document, execute the script contained in that element. However, if the element is found
    within a transformation expressed in XSLT (assuming the user agent also supports XSLT), then
    the processor would instead treat the <code><a data-link-type="element" href="semantics-scripting.html#elementdef-script" id="ref-for-elementdef-script-7">script</a></code> element as an opaque element that
    forms part of the transform. </p>
      <p>Web browsers that support <a href="syntax.html#syntax">the HTML syntax</a> must process documents labeled with an <a data-link-type="dfn" href="infrastructure.html#html-mime-type" id="ref-for-html-mime-type-1">HTML MIME type</a> as described in this specification, so that users can interact with
  them.</p>
      <p>User agents that support scripting must also be conforming implementations of the IDL
  fragments in this specification, as described in the Web IDL specification. <a data-link-type="biblio" href="references.html#biblio-webidl">[WEBIDL]</a></p>
      <p class="note" role="note"> Unless explicitly stated, specifications that override the semantics of HTML elements do not
    override the requirements on DOM objects representing those elements. For example, the <code><a data-link-type="element" href="semantics-scripting.html#elementdef-script" id="ref-for-elementdef-script-8">script</a></code> element in the example above would still implement the <code class="idl"><a data-link-type="idl" href="semantics-scripting.html#htmlscriptelement-htmlscriptelement" id="ref-for-htmlscriptelement-htmlscriptelement-1">HTMLScriptElement</a></code> interface. </p>
     </dd><dt data-md="">
      <p>Non-interactive presentation user agents</p>
     </dt><dd data-md="">
      <p>User agents that process HTML and XHTML documents purely to render non-interactive versions
  of them must comply to the same conformance criteria as Web browsers, except that they are
  exempt from requirements regarding user interaction.</p>
      <p class="note" role="note"> Typical examples of non-interactive presentation user agents are printers (static user agents) and
    overhead displays (dynamic user agents). It is expected that most static non-interactive
    presentation user agents will also opt to <a data-link-type="dfn" href="infrastructure.html#lack-scripting-support" id="ref-for-lack-scripting-support-1">lack scripting support</a>. </p>
      <p class="example" id="example-84f7a997"><a class="self-link" href="infrastructure.html#example-84f7a997"></a> A non-interactive but dynamic presentation user agent would still execute scripts, allowing forms
    to be dynamically submitted, and so forth. However, since the concept of "focus" is
    irrelevant when the user cannot interact with the document, the user agent would not need to support
    any of the focus-related DOM APIs. </p>
     </dd><dt data-md="">
      <p><dfn class="dfn-paneled" data-dfn-for="rendering" data-dfn-type="dfn" data-lt="support the suggested default rendering|supporting the suggested default rendering|Visual user agents that support the suggested default rendering" data-noexport="" id="rendering-support-the-suggested-default-rendering">Visual user agents that support the suggested default rendering</dfn></p>
     </dt><dd data-md="">
      <p>User agents, whether interactive or not, may be designated (possibly as a user option) as <a data-link-type="dfn" href="infrastructure.html#rendering-support-the-suggested-default-rendering" id="ref-for-rendering-support-the-suggested-default-rendering-1">supporting the suggested default rendering</a> defined by this specification.</p>
      <p>This is not required. In particular, even user agents that do implement the suggested default
  rendering are encouraged to offer settings that override this default to improve the
  experience for the user, e.g., changing the color contrast, using different focus styles, or
  otherwise making the experience more accessible and usable to the user.</p>
      <p>User agents that are designated as <a data-link-type="dfn" href="infrastructure.html#rendering-support-the-suggested-default-rendering" id="ref-for-rendering-support-the-suggested-default-rendering-2">supporting the suggested default rendering</a> must, while so
  designated, implement the rules in <a href="rendering.html#rendering">§10 Rendering</a>. That section defines
  the behavior that user agents are <em>expected</em> to implement.</p>
     </dd><dt data-md="">
      <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="lack scripting support|User agents with no scripting support|do not support scripting" data-noexport="" id="lack-scripting-support">User agents with no scripting support</dfn></p>
     </dt><dd data-md="">
      <p>Implementations that do not support scripting (or which have their scripting features disabled
  entirely) are exempt from supporting the events and DOM interfaces mentioned in this
  specification. For the parts of this specification that are defined in terms of an events
  model or in terms of the DOM, such user agents must still act as if events and the DOM were
  supported.</p>
      <p class="note" role="note"> Scripting can form an integral part of an application. Web browsers that do not support
      scripting, or that have scripting disabled, might be unable to fully convey the author’s
      intent. </p>
     </dd><dt data-md="">
      <p>Conformance checkers</p>
     </dt><dd data-md="">
      <p>Conformance checkers must verify that a document conforms to the applicable conformance
  criteria described in this specification. Automated conformance checkers are exempt from
  detecting errors that require interpretation of the author’s intent (for example, while a
  document is non-conforming if the content of a <code><a data-link-type="element" href="grouping-content.html#elementdef-blockquote" id="ref-for-elementdef-blockquote-1">blockquote</a></code> element is not a quote,
  conformance checkers running without the input of human judgement do not have to check that <code><a data-link-type="element" href="grouping-content.html#elementdef-blockquote" id="ref-for-elementdef-blockquote-2">blockquote</a></code> elements only contain quoted material).</p>
      <p>Conformance checkers must check that the input document conforms when parsed without a <a data-link-type="dfn" href="browsers.html#browsing-context" id="ref-for-browsing-context-3">browsing context</a> (meaning that no scripts are run, and that the parser’s <a data-link-type="dfn" href="syntax.html#scripting-flag" id="ref-for-scripting-flag-1">scripting flag</a> is disabled), and should also check that the input document conforms
  when parsed with a <a data-link-type="dfn" href="browsers.html#browsing-context" id="ref-for-browsing-context-4">browsing context</a> in which scripts execute, and that the scripts
  never cause non-conforming states to occur other than transiently during script execution
  itself. (This is only a "SHOULD" and not a "MUST" requirement because it has been proven to be
  impossible. <a data-link-type="biblio" href="references.html#biblio-computable">[COMPUTABLE]</a>)</p>
      <p>The term "HTML validator" can be used to refer to a conformance checker that itself conforms
  to the applicable requirements of this specification.</p>
      <div class="note" role="note">
        XML DTDs cannot express all the conformance requirements of this specification. Therefore, a
    validating XML processor and a DTD cannot constitute a conformance checker. Also, since
    neither of the two authoring formats defined in this specification are applications of SGML,
    a validating SGML system cannot constitute a conformance checker either. 
       <p>To put it another way, there are three types of conformance criteria:</p>
       <ol>
        <li data-md="">
         <p>Criteria that can be expressed in a DTD.</p>
        </li><li data-md="">
         <p>Criteria that cannot be expressed by a DTD, but can still be checked by a machine.</p>
        </li><li data-md="">
         <p>Criteria that can only be checked by a human.</p>
       </li></ol>
       <p>A conformance checker must check for the first two. A simple DTD-based validator only checks
    for the first class of errors and is therefore not a conforming conformance checker
    according to this specification.</p>
      </div>
     </dd><dt data-md="">
      <p>Data mining tools</p>
     </dt><dd data-md="">
      <p>Applications and tools that process HTML and XHTML documents for reasons other than to either
  render the documents or check them for conformance should act in accordance with the semantics
  of the documents that they process.</p>
      <p class="example" id="example-7be76795"><a class="self-link" href="infrastructure.html#example-7be76795"></a> A tool that generates <a data-link-type="dfn" href="sections.html#outline" id="ref-for-outline-1">document outlines</a> but increases the nesting level for each
    paragraph and does not increase the nesting level for each section would not be conforming. </p>
     </dd><dt data-md="">
      <p>Authoring tools and markup generators</p>
     </dt><dd data-md="">
      <p>Authoring tools and markup generators must generate <a data-link-type="dfn" href="infrastructure.html#conforming-document" id="ref-for-conforming-document-2">conforming documents</a>. Conformance
  criteria that apply to authors also apply to authoring tools, where appropriate.</p>
      <p>Authoring tools are exempt from the strict requirements of using elements only for their
  specified purpose, but only to the extent that authoring tools are not yet able to determine
  author intent. However, authoring tools must not automatically misuse elements or encourage
  their users to do so.</p>
      <p class="example" id="example-aed9a104"><a class="self-link" href="infrastructure.html#example-aed9a104"></a> For example, it is not conforming to use an <code><a data-link-type="element" href="sections.html#elementdef-address" id="ref-for-elementdef-address-1">address</a></code> element for arbitrary
    contact information; that element can only be used for marking up contact information for
    the author of the document or section. However, since an authoring tool is likely unable to
    determine the difference, an authoring tool is exempt from that requirement. This does not
    mean, though, that authoring tools can use <code><a data-link-type="element" href="sections.html#elementdef-address" id="ref-for-elementdef-address-2">address</a></code> elements for any block of
    italics text (for instance); it just means that the authoring tool doesn’t have to verify,
    if a user inserts contact information for a section or something else. </p>
      <p class="note" role="note"> In terms of conformance checking, an editor has to output documents that conform to the same
    extent that a conformance checker will verify. </p>
      <p>When an authoring tool is used to edit a non-conforming document, it may preserve the
  conformance errors in sections of the document that were not edited during the editing session
  (i.e., an editing tool is allowed to round-trip erroneous content). However, an authoring tool
  must not claim that the output is conformant if errors have been so preserved.</p>
      <p>Authoring tools are expected to come in two broad varieties: tools that work from structure
  or semantic data, and tools that work on a What-You-See-Is-What-You-Get media-specific editing
  basis (WYSIWYG).</p>
      <p>The former is the preferred mechanism for tools that author HTML, since the structure in the
  source information can be used to make informed choices regarding which HTML elements and
  attributes are most appropriate.</p>
      <p>However, WYSIWYG tools are legitimate. WYSIWYG tools should use elements they know are
  appropriate, and should not use elements that they do not know to be appropriate. This might
  in certain extreme cases mean limiting the use of flow elements to just a few elements, like <code><a data-link-type="element" href="grouping-content.html#elementdef-div" id="ref-for-elementdef-div-5">div</a></code>, <code><a data-link-type="element" href="textlevel-semantics.html#elementdef-b" id="ref-for-elementdef-b-2">b</a></code>, <code><a data-link-type="element" href="textlevel-semantics.html#elementdef-i" id="ref-for-elementdef-i-13">i</a></code>, and <code><a data-link-type="element" href="textlevel-semantics.html#elementdef-span" id="ref-for-elementdef-span-5">span</a></code> and making liberal use of the <code><a data-link-type="element-sub" href="dom.html#element-attrdef-global-style" id="ref-for-element-attrdef-global-style-3">style</a></code> attribute.</p>
      <p>All authoring tools, whether WYSIWYG or not, should make a best effort attempt at enabling
  users to create well-structured, semantically rich, media-independent content.</p>
    </dd></dl>
    <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="hardware limitations|practical concerns" data-noexport="" id="hardware-limitations"></dfn>User agents may impose implementation-specific limits on otherwise unconstrained inputs, e.g., to
  prevent denial of service attacks, to guard against running out of memory, or to work around
  platform-specific limitations. <a class="fingerprint" href="introduction.html#fingerprinting-vector" id="ref-for-fingerprinting-vector-3"><img alt="(This is a fingerprinting vector.)" height="21" src="images/fingerprint.png" width="15"></a></p>
    <p>For compatibility with existing content and prior specifications, this specification describes
  two authoring formats: one based on XML (referred to as <a href="xhtml.html#xhtml">the XHTML syntax</a>), and one using a <a href="syntax.html#writing-html-documents">custom format</a> inspired by SGML (referred to as <a href="syntax.html#syntax">the HTML syntax</a>). Implementations
  must support at least one of these two formats, although supporting both is encouraged.</p>
    <p>Some conformance requirements are phrased as requirements on elements, attributes, methods or
  objects. Such requirements fall into two categories: those describing content model restrictions,
  and those describing implementation behavior. Those in the former category are requirements on
  documents and authoring tools. Those in the second category are requirements on user agents.
  Similarly, some conformance requirements are phrased as requirements on authors; such requirements
  are to be interpreted as conformance requirements on the documents that authors produce. (In other
  words, this specification does not distinguish between conformance criteria on authors and
  conformance criteria on documents.)</p>
    <h4 class="heading settled" data-level="2.2.2" id="conformance-requirements-dependencies"><span class="secno">2.2.2. </span><span class="content">Dependencies</span><a class="self-link" href="infrastructure.html#conformance-requirements-dependencies"></a></h4>
    <p>This specification relies on several other underlying specifications.</p>
    <dl>
     <dt data-md="">
      <p>Unicode and Encoding</p>
     </dt><dd data-md="">
      <p>The Unicode character set is used to represent textual data, and the Encoding standard defines
  requirements around <a data-link-type="dfn" href="infrastructure.html#character-encoding" id="ref-for-character-encoding-1">character encodings</a>. <a data-link-type="biblio" href="references.html#biblio-unicode">[UNICODE]</a></p>
      <p class="note" role="note"> This specification <a data-link-type="dfn" href="infrastructure.html#character-encoding" id="ref-for-character-encoding-2">introduces terminology</a> based on the terms defined in those
    specifications, as described earlier. </p>
      <p>The following terms are used as defined in the Encoding standard: <a data-link-type="biblio" href="references.html#biblio-encoding">[ENCODING]</a></p>
      <ul>
       <li data-md="">
        <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="getting-an-encoding">Getting an encoding</dfn></p>
       </li><li data-md="">
        <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="getting an output encoding" data-noexport="" id="getting-an-output-encoding">Get an output encoding</dfn></p>
       </li><li data-md="">
        <p>The generic <a data-link-type="dfn" href="https://www.w3.org/TR/encoding/#decode">decode</a> algorithm which takes a byte stream and an encoding and
returns a character stream</p>
       </li><li data-md="">
        <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="utf-8-decode">UTF-8 decode</dfn> algorithm which takes a byte stream and returns a character
stream, additionally stripping one leading UTF-8 Byte Order Mark (BOM), if any</p>
       </li><li data-md="">
        <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="utf-8-decode-without-bom">UTF-8 decode without BOM</dfn> algorithm which is identical to <a data-link-type="dfn" href="infrastructure.html#utf-8-decode" id="ref-for-utf-8-decode-1">UTF-8 decode</a> except that it does not strip one leading UTF-8 Byte Order Mark (BOM)</p>
       </li><li data-md="">
        <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="utf-8-decode-without-bom-or-fail">UTF-8 decode without BOM or fail</dfn> algorithm which is identical to <a data-link-type="dfn" href="infrastructure.html#utf-8-decode-without-bom" id="ref-for-utf-8-decode-without-bom-1">UTF-8 decode without BOM</a> except that it returns failure upon encountering an error</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/encoding/#encode">encode</a> algorithm which takes a character stream and an
encoding and returns a byte stream</p>
       </li><li data-md="">
        <p>The <dfn data-dfn-type="dfn" data-noexport="" id="utf-8-encode">UTF-8 encode<a class="self-link" href="infrastructure.html#utf-8-encode"></a></dfn> algorithm which takes a character stream and returns a byte stream.</p>
      </li></ul>
     </dd><dt data-md="">
      <p>XML and related specifications</p>
     </dt><dd data-md="">
      <p>Implementations that support <a href="xhtml.html#xhtml">the XHTML syntax</a> must support some version of XML, as
  well as its corresponding namespaces specification, because that syntax uses an XML
  serialization with namespaces. <a data-link-type="biblio" href="references.html#biblio-xml">[XML]</a> <a data-link-type="biblio" href="references.html#biblio-xml-names">[XML-NAMES]</a></p>
      <p>The attribute with the tag name <a data-link-type="dfn" href="https://www.w3.org/TR/xml/#sec-white-space"><code>xml:space</code></a> in the <a data-link-type="dfn" href="infrastructure.html#xml-namespace" id="ref-for-xml-namespace-1">XML namespace</a> is defined by the XML specification. <a data-link-type="biblio" href="references.html#biblio-xml">[XML]</a></p>
      <p>This specification also references the <a data-link-type="dfn" href="https://www.w3.org/TR/xml-stylesheet/#the-xml-stylesheet-processing-instruction"><code>&lt;?xml-stylesheet?&gt;</code></a> processing instruction, defined in the <cite>Associating Style Sheets with XML documents</cite> specification. <a data-link-type="biblio" href="references.html#biblio-xml-stylesheet">[XML-STYLESHEET]</a></p>
      <p>This specification also non-normatively mentions the <dfn class="idl-code" data-dfn-type="interface" data-export="" id="xsltprocessor"><code>XSLTProcessor</code><a class="self-link" href="infrastructure.html#xsltprocessor"></a></dfn> interface and its <dfn class="idl-code" data-dfn-for="XSLTProcessor" data-dfn-type="method" data-export="" id="dom-xsltprocessor-transformtofragment"><code>transformToFragment()</code><a class="self-link" href="infrastructure.html#dom-xsltprocessor-transformtofragment"></a></dfn> and <dfn class="idl-code" data-dfn-for="XSLTProcessor" data-dfn-type="method" data-export="" id="dom-xsltprocessor-transformtodocument"><code>transformToDocument()</code><a class="self-link" href="infrastructure.html#dom-xsltprocessor-transformtodocument"></a></dfn> methods.</p>
     </dd><dt data-md="">
      <p>URLs</p>
     </dt><dd data-md="">
      <p>The following terms are defined in the WHATWG URL standard: <a data-link-type="biblio" href="references.html#biblio-url">[URL]</a></p>
      <ul>
       <li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-host">host</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-domain">domain</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin">Origin</a> of URLs</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#syntax-url-absolute">Absolute URL</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#syntax-url-relative">Relative URL</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#syntax-url-scheme-relative">Relative schemes</a></p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser">URL parser</a> and <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-basic-url-parser">basic URL parser</a> as well as these parser states:</p>
        <ul>
         <li data-md="">
          <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#scheme-start-state">scheme start state</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#host-state">host state</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#hostname-state">hostname state</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#port-state">port state</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#path-start-state">path start state</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#query-state">query state</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#fragment-state">fragment state</a></p>
        </li></ul>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url">URL record</a>, as well as its individual components:</p>
        <ul>
         <li data-md="">
          <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-scheme">scheme</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-username">username</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-password">password</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-host">host</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-port">port</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-path">path</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-query">query</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-fragment">fragment</a></p>
        </li></ul>
       </li><li data-md="">
        <p>A <a data-link-type="dfn" href="https://url.spec.whatwg.org/#network-scheme">network scheme</a></p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-serializer">URL serializer</a></p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-host-parser">host parser</a></p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-host-serializer">host serializer</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-host-equals">Host equals</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#serialize-an-integer">serialize an integer</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#default-encode-set">Default encode set</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#percent-encode">Percent encode</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#utf-8-percent-encode">UTF-8 percent encode</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#percent-decode">Percent decode</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#set-the-username">set the username</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#set-the-password">set the password</a></p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-domain-to-ascii">domain to ASCII</a> algorithm</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-domain-to-unicode">domain to Unicode</a> algorithm</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#non-relative-flag">non-relative flag</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#syntax-violation">Parse errors</a> from the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser">URL parser</a></p>
      </li></ul>
      <p>A number of schemes and protocols are referenced by this specification also:</p>
      <ul>
       <li data-md="">
        <p>The <dfn class="dfn-paneled" data-dfn-type="scheme" data-export="" data-lt="about:|about:blank" id="schemedef-about"><a data-link-type="scheme" href="infrastructure.html#schemedef-about" id="ref-for-schemedef-about-1"><code>about:</code></a></dfn> scheme <a data-link-type="biblio" href="references.html#biblio-rfc6694">[RFC6694]</a></p>
       </li><li data-md="">
        <p>The <dfn class="dfn-paneled" data-dfn-type="scheme" data-export="" id="schemedef-blob"><a data-link-type="scheme" href="infrastructure.html#schemedef-blob" id="ref-for-schemedef-blob-1"><code>blob:</code></a></dfn> scheme <a data-link-type="biblio" href="references.html#biblio-fileapi">[FILEAPI]</a></p>
       </li><li data-md="">
        <p>The <dfn class="dfn-paneled" data-dfn-type="scheme" data-export="" data-lt="data: url|data:|data url" id="schemedef-data-url"><code>data:</code></dfn> scheme <a data-link-type="biblio" href="references.html#biblio-rfc2397">[RFC2397]</a></p>
       </li><li data-md="">
        <p>The <dfn data-dfn-type="scheme" data-export="" id="schemedef-http"><code>http:</code><a class="self-link" href="infrastructure.html#schemedef-http"></a></dfn> scheme <a data-link-type="biblio" href="references.html#biblio-http">[HTTP]</a></p>
       </li><li data-md="">
        <p>The <dfn data-dfn-type="scheme" data-export="" id="schemedef-https"><code>https:</code><a class="self-link" href="infrastructure.html#schemedef-https"></a></dfn> scheme <a data-link-type="biblio" href="references.html#biblio-http">[HTTP]</a></p>
       </li><li data-md="">
        <p>The <dfn data-dfn-type="scheme" data-export="" id="schemedef-mailto"><code>mailto:</code><a class="self-link" href="infrastructure.html#schemedef-mailto"></a></dfn> scheme <a data-link-type="biblio" href="references.html#biblio-rfc6068">[RFC6068]</a></p>
       </li><li data-md="">
        <p>The <dfn data-dfn-type="scheme" data-export="" id="schemedef-sms"><code>sms:</code><a class="self-link" href="infrastructure.html#schemedef-sms"></a></dfn> scheme <a data-link-type="biblio" href="references.html#biblio-rfc5724">[RFC5724]</a></p>
       </li><li data-md="">
        <p>The <dfn data-dfn-type="scheme" data-export="" id="schemedef-urn"><code>urn:</code><a class="self-link" href="infrastructure.html#schemedef-urn"></a></dfn> scheme <a data-link-type="biblio" href="references.html#biblio-urn">[URN]</a></p>
      </li></ul>
     </dd><dt data-md="">
      <p>HTTP and related specifications</p>
     </dt><dd data-md="">
      <p>The following terms are defined in the HTTP specifications: <a data-link-type="biblio" href="references.html#biblio-http">[HTTP]</a></p>
      <ul>
       <li data-md="">
        <p><a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7231#section-5.3.2"><code>Accept</code></a> header</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7231#section-5.3.5"><code>Accept-Language</code></a> header</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7234#section-5.2"><code>Cache-Control</code></a> header</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tools.ietf.org/html/rfc6266#section-4.1"><code>Content-Disposition</code></a> header</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7231#section-3.1.3.2"><code>Content-Language</code></a> header</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7230#section-3.3.2"><code>Content-Length</code></a> header</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7232#section-2.2"><code>Last-Modified</code></a> header</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7231#section-5.5.2"><code>Referer</code></a> header</p>
      </li></ul>
      <p>The following terms are defined in the Cookie specification: <a data-link-type="biblio" href="references.html#biblio-cookies">[COOKIES]</a></p>
      <ul>
       <li data-md="">
        <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="cookie-string">cookie-string</dfn></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tools.ietf.org/html/rfc6265#section-4.1">receives a set-cookie-string</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tools.ietf.org/html/rfc6265#section-5.4"><code>Cookie</code> header</a></p>
      </li></ul>
      <p>The following term is defined in the Web Linking specification: <a data-link-type="biblio" href="references.html#biblio-rfc5988">[RFC5988]</a></p>
      <ul>
       <li data-md="">
        <p><a data-link-type="dfn" href="https://tools.ietf.org/html/rfc5988#section-5"><code>Link</code> header</a></p>
      </li></ul>
     </dd><dt data-md="">
      <p>Fetch</p>
     </dt><dd data-md="">
      <p>The following terms are defined in the WHATWG Fetch standard: <a data-link-type="biblio" href="references.html#biblio-fetch">[FETCH]</a></p>
      <ul>
       <li data-md="">
        <p><a data-link-type="scheme" href="infrastructure.html#schemedef-about" id="ref-for-schemedef-about-2"><code>about:blank</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-https-state-value">HTTPS state value</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-referrer-policy">referrer policy</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#http-cors-protocol">CORS protocol</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#default-user-agent-value">default <code>User-Agent</code> value</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-extract-mime-type">extract a MIME type</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch">fetch</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#ok-status">ok status</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#origin-header"><code>Origin</code> header</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#process-response">process response</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-list-set">set</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch-terminate">terminate</a></p>
       </li><li data-md="">
        <p>the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#requestcredentials"><code>RequestCredentials</code></a> enumeration</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response">response</a> and its associated:</p>
        <ul>
         <li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-type">type</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-url">url</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-url-list">url list</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-status">status</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list">header list</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-body">body</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-internal-response">internal response</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-csp-list">CSP list</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-https-state">HTTPS state</a></p>
        </li></ul>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request">request</a> and its associated:</p>
        <ul>
         <li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url">url</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-method">method</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-header-list">header list</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-body">body</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-client">client</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-target-browsing-context">target browsing context</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-initiator">initiator</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-type">type</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-destination">destination</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-origin">origin</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#omit-origin-header-flag">omit-<code>Origin</code>-header flag</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#same-origin-data-url-flag">same-origin data-URL flag</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-referrer">referrer</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#synchronous-flag">synchronous flag</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-mode">mode</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-credentials-mode">credentials mode</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-use-url-credentials-flag">use-URL-credentials flag</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#unsafe-request-flag">unsafe-request flag</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-cache-mode">cache mode</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-redirect-mode">redirect mode</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-nonce-metadata">cryptographic nonce metadata</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-parser-metadata">parser metadata</a></p>
        </li></ul>
      </li></ul>
     </dd><dt data-md="">
      <p>Web IDL</p>
     </dt><dd data-md="">
      <p>The IDL fragments in this specification must be interpreted as required for conforming IDL
  fragments, as described in the Web IDL specification. <a data-link-type="biblio" href="references.html#biblio-webidl">[WEBIDL]</a></p>
      <p>The following terms are defined in the Web IDL specification:</p>
      <ul>
       <li data-md="">
        <p><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-array-index-property-name">array index property name</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#dfn-supported-property-indices">supported property indices</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#dfn-determine-the-value-of-an-indexed-property">Determine the value of an indexed property</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-support-named-properties">Support named properties</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-supported-property-names">Supported property names</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-determine-the-value-of-a-named-property">Determine the value of a named property</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-perform-a-security-check">perform a security check</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-platform-object">Platform object</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#es-platform-objects">Global environment associated with</a> a platform object</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#dfn-read-only">Read only</a> (when applied to arrays)</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-callback-this-value">Callback this value</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#es-type-mapping">Converting</a> between WebIDL types and JS types</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#es-invoking-callback-functions">invoke the Web IDL callback function</a></p>
      </li></ul>
      <p>The Web IDL specification also defines the following types that are used in Web IDL fragments
  in this specification:</p>
      <ul>
       <li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#common-ArrayBufferView"><code>ArrayBufferView</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="type" href="https://www.w3.org/TR/WebIDL-1/#idl-boolean"><code>boolean</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="type" href="https://www.w3.org/TR/WebIDL-1/#idl-DOMString" title="Expands to: validation steps"><code>DOMString</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="type" href="https://www.w3.org/TR/WebIDL-1/#idl-USVString"><code>USVString</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="type" href="https://www.w3.org/TR/WebIDL-1/#idl-double"><code>double</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="type" href="https://www.w3.org/TR/WebIDL-1/#idl-Error"><code>Error</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://drafts.csswg.org/css-syntax-3/#function"><code>Function</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="type" href="https://www.w3.org/TR/WebIDL-1/#idl-long"><code>long</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-object"><code>object</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="type" href="https://www.w3.org/TR/WebIDL-1/#idl-unrestricted-double"><code>unrestricted double</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="type" href="https://www.w3.org/TR/WebIDL-1/#idl-unsigned-long"><code>unsigned long</code></a></p>
      </li></ul>
      <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="throw">throw</dfn> in this specification is used as defined in the WebIDL
  specification. The following exception names are defined by WebIDL and used by this
  specification:</p>
      <ul>
       <li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#indexsizeerror"><code>IndexSizeError</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#hierarchyrequesterror"><code>HierarchyRequestError</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#invalidcharactererror"><code>InvalidCharacterError</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#notfounderror"><code>NotFoundError</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#notsupportederror"><code>NotSupportedError</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#invalidstateerror"><code>InvalidStateError</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#syntaxerror"><code>SyntaxError</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#invalidaccesserror"><code>InvalidAccessError</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#securityerror"><code>SecurityError</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#networkerror"><code>NetworkError</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#quotaexceedederror"><code>QuotaExceededError</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#timeouterror"><code>TimeoutError</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#datacloneerror"><code>DataCloneError</code></a></p>
      </li></ul>
      <p>When this specification requires a user agent to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="date object|a new date object" data-noexport="" id="date-object">create a <code class="idl"><a data-link-type="idl" href="http://www.ecma-international.org/ecma-262/6.0/#sec-date-constructor">Date</a></code> object</dfn> representing a particular time (which could be the special value Not-a-Number), the
  milliseconds component of that time, if any, must be truncated to an integer, and the time
  value of the newly created <code class="idl"><a data-link-type="idl" href="http://www.ecma-international.org/ecma-262/6.0/#sec-date-constructor">Date</a></code> object must represent the resulting truncated
  time.</p>
      <p class="example" id="example-98552a4c"><a class="self-link" href="infrastructure.html#example-98552a4c"></a> For instance, given the time 23045 millionths of a second after 01:00 UTC on
    January 1st 2000, i.e., the time 2000-01-01T00:00:00.023045Z, then the <code class="idl"><a data-link-type="idl" href="http://www.ecma-international.org/ecma-262/6.0/#sec-date-constructor">Date</a></code> object
    created representing that time would represent the same time as that created representing the
    time 2000-01-01T00:00:00.023Z, 45 millionths earlier. If the given time is NaN, then the result
    is a <code class="idl"><a data-link-type="idl" href="http://www.ecma-international.org/ecma-262/6.0/#sec-date-constructor">Date</a></code> object that represents a time value NaN (indicating that the object does
    not represent a specific instant of time). </p>
     </dd><dt data-md="">
      <p>JavaScript</p>
     </dt><dd data-md="">
      <p>Some parts of the language described by this specification only support JavaScript as the
  underlying scripting language. <a data-link-type="biblio" href="references.html#biblio-ecma-262">[ECMA-262]</a></p>
      <p class="note" role="note"> The term "JavaScript" is used to refer to ECMA262, rather than the official term ECMAScript,
    since the term JavaScript is more widely known. Similarly, the <a data-link-type="dfn" href="infrastructure.html#mime-type" id="ref-for-mime-type-5">MIME type</a> used to
    refer to JavaScript in this specification is <code>text/javascript</code>, since that is the
    most commonly used type, <a data-link-type="dfn" href="introduction.html#willful-violation" id="ref-for-willful-violation-1">despite it being an officially obsoleted type</a> according to
    RFC 4329. <a data-link-type="biblio" href="references.html#biblio-rfc4329">[RFC4329]</a> </p>
      <p>The following terms are defined in the JavaScript specification and used in this
  specification <a data-link-type="biblio" href="references.html#biblio-ecma-262">[ECMA-262]</a>:</p>
      <ul>
       <li data-md="">
        <p><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-automatic-semicolon-insertion">automatic semicolon insertion</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#early-error-rule">early error</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#directive-prologue">Directive Prologue</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-execution-contexts">JavaScript execution context</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#execution-context-stack">JavaScript execution context stack</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#running-execution-context">running JavaScript execution context</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms">JavaScript realm</a></p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#current-realm">current Realm Record</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#use-strict-directive">Use Strict Directive</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-well-known-symbols">Well-Known Symbols</a>, including:</p>
        <ul>
         <li data-md="">
          <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="hasinstance">@@hasInstance</dfn></p>
         </li><li data-md="">
          <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="isconcatspreadable">@@isConcatSpreadable</dfn></p>
         </li><li data-md="">
          <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="toprimitive">@@toPrimitive</dfn></p>
         </li><li data-md="">
          <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="tostringtag">@@toStringTag</dfn></p>
        </li></ul>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-well-known-intrinsic-objects">Well-Known Intrinsic Objects</a>, including:</p>
        <ul>
         <li data-md="">
          <p><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor">%ArrayBuffer%</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-properties-of-the-array-prototype-object">%ArrayPrototype%</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object.prototype.tostring">%ObjProto_toString%</a></p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object.prototype.valueof">%ObjProto_valueOf%</a></p>
        </li></ul>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#prod-FunctionBody">FunctionBody</a> production</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#prod-Pattern">Pattern</a> production</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#prod-Script">Script</a> production</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a> notation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">List</a> and <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">Record</a> specification types</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-property-descriptor-specification-type">Property Descriptor</a> specification type</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-arraycreate">ArrayCreate</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-call">Call</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-clonearraybuffer">CloneArrayBuffer</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-construct">Construct</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-createdataproperty">CreateDataProperty</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-detacharraybuffer">DetachArrayBuffer</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-enqueuejob">EnqueueJob</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-functioncreate">FunctionCreate</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-get-o-p">Get</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-getactivescriptormodule">GetActiveScriptOrModule</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-getfunctionrealm">GetFunctionRealm</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-hasownproperty">HasOwnProperty</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-hostensurecancompilestrings">HostEnsureCanCompileStrings</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-host-promise-rejection-tracker">HostPromiseRejectionTracker</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-initializehostdefinedrealm">InitializeHostDefinedRealm</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-isaccessordescriptor">IsAccessorDescriptor</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-iscallable">IsCallable</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-isconstructor">IsConstructor</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-isdatadescriptor">IsDataDescriptor</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-isdetachedbuffer">IsDetachedBuffer</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-newobjectenvironment">NewObjectEnvironment</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof">OrdinaryGetPrototypeOf</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ordinarysetprototypeof">OrdinarySetPrototypeOf</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ordinaryisextensible">OrdinaryIsExtensible</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ordinarypreventextensions">OrdinaryPreventExtensions</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ordinarygetownproperty">OrdinaryGetOwnProperty</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ordinarydefineownproperty">OrdinaryDefineOwnProperty</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ordinaryget">OrdinaryGet</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ordinaryset">OrdinarySet</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ordinarydelete">OrdinaryDelete</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys">OrdinaryOwnPropertyKeys</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-parse-script">ParseScript</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-runjobs">RunJobs</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-samevalue">SameValue</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-runtime-semantics-scriptevaluation">ScriptEvaluation</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-toboolean">ToBoolean</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-tostring">ToString</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-touint32">ToUint32</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#typedarray-create">TypedArrayCreate</a> abstract operation</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-abstract-equality-comparison">Abstract Equality Comparison</a> algorithm</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-strict-equality-comparison">Strict Equality Comparison</a> algorithm</p>
       </li><li data-md="">
        <p>The <code class="idl"><a data-link-type="idl" href="http://www.ecma-international.org/ecma-262/6.0/#sec-arraybuffer-constructor">ArrayBuffer</a></code> object</p>
       </li><li data-md="">
        <p>The <code class="idl"><a data-link-type="idl" href="http://www.ecma-international.org/ecma-262/6.0/#sec-date-constructor">Date</a></code> object</p>
       </li><li data-md="">
        <p>The <code class="idl"><a data-link-type="idl" href="http://www.ecma-international.org/ecma-262/6.0/#sec-native-error-types-used-in-this-standard-syntaxerror">SyntaxError</a></code> object</p>
       </li><li data-md="">
        <p>The <code class="idl"><a data-link-type="idl" href="http://www.ecma-international.org/ecma-262/6.0/#sec-native-error-types-used-in-this-standard-typeerror">TypeError</a></code> object</p>
       </li><li data-md="">
        <p>The <code class="idl"><a data-link-type="idl" href="http://www.ecma-international.org/ecma-262/6.0/#sec-native-error-types-used-in-this-standard-rangeerror">RangeError</a></code> object</p>
       </li><li data-md="">
        <p>The <code class="idl"><a data-link-type="idl" href="http://www.ecma-international.org/ecma-262/6.0/#sec-regexp-constructor">RegExp</a></code> object</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-typeof-operator">typeof</a> operator</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#table-49">The TypedArray Constructors</a> table</p>
      </li></ul>
     </dd><dt data-md="">
      <p>DOM</p>
     </dt><dd data-md="">
      <p>The Document Object Model (DOM) is a representation — a model — of a document and
  its content. The DOM is not just an API; the conformance criteria of HTML implementations are
  defined, in this specification, in terms of operations on the DOM. <a data-link-type="biblio" href="references.html#biblio-dom">[DOM]</a></p>
      <p>Implementations must support DOM and the events defined in UI Events, because this
  specification is defined in terms of the DOM, and some of the features are defined as
  extensions to the DOM interfaces. <a data-link-type="biblio" href="references.html#biblio-dom">[DOM]</a> <a data-link-type="biblio" href="references.html#biblio-uievents">[UIEVENTS]</a></p>
      <p>In particular, the following features are defined in the DOM specification: <a data-link-type="biblio" href="references.html#biblio-dom">[DOM]</a></p>
      <ul>
       <li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#attr">Attr</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#comment">Comment</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#domimplementation">DOMImplementation</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#xmldocument">XMLDocument</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#documentfragment">DocumentFragment</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#documenttype">DocumentType</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/WebIDL-1/#idl-DOMException">DOMException</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#childnode">ChildNode</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#interface-element">Element</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#node">Node</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#nodelist">NodeList</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#processinginstruction">ProcessingInstruction</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#text">Text</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#htmlcollection">HTMLCollection</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-nodelist-item">item()</a></code> method</p>
       </li><li data-md="">
        <p>The terms <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-collection">collections</a> and <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#represented-by-the-collection">represented by the collection</a></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#domtokenlist">DOMTokenList</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-domimplementation-createdocument">createDocument()</a></code> method</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-domimplementation-createhtmldocument">createHTMLDocument()</a></code> method</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-document-createelement">createElement()</a></code> method</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-document-createelementns">createElementNS()</a></code> method</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-nonelementparentnode-getelementbyid">getElementById()</a></code> method</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-element-getelementsbyclassname">getElementsByClassName()</a></code> method</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-node-insertbefore">insertBefore()</a></code> method</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-node-appendchild">appendChild()</a></code> method</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-node-clonenode">cloneNode()</a></code> method</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-document-importnode">importNode()</a></code> method</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-node-childnodes">childNodes</a></code> attribute</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-element-localname">localName</a></code> attribute</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-node-parentnode">parentNode</a></code> attribute</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-element-namespaceuri">namespaceURI</a></code> attribute</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-element-tagname">tagName</a></code> attribute</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-element-id">id</a></code> attribute</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-node-textcontent">textContent</a></code> attribute</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-insert">insert</a>, <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-append">append</a>, <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-remove">remove</a>, <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-replace">replace</a>, and <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-adopt">adopt</a> algorithms for nodes</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-insert">insertion steps</a>, <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-remove">removing steps</a>, and <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-adopt">adopting steps</a> hooks</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-element-attribute">attribute list</a> concept.</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-cd-data">data</a> of a text node.</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#event">Event</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#eventtarget">EventTarget</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dictdef-eventinit">EventInit</a></code> dictionary type</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-event-target">target</a></code> attribute</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-event-currenttarget">currentTarget</a></code> attribute</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-event-istrusted">isTrusted</a></code> attribute</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-event-initevent">initEvent()</a></code> method</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-eventtarget-addeventlistener">addEventListener()</a></code> method</p>
       </li><li data-md="">
        <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#dom-event-type">type</a></code> of an event</p>
       </li><li data-md="">
        <p>The concept of an <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-event-listener">event listener</a> and the <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-event-listener">event listeners</a> associated with
an <code>EventTarget</code></p>
       </li><li data-md="">
        <p>The concept of a <dfn data-dfn-type="dfn" data-noexport="" id="target-override">target override<a class="self-link" href="infrastructure.html#target-override"></a></dfn></p>
       </li><li data-md="">
        <p>The concept of a regular <dfn data-dfn-type="dfn" data-noexport="" id="event-parent">event parent<a class="self-link" href="infrastructure.html#event-parent"></a></dfn> and a <dfn data-dfn-type="dfn" data-noexport="" id="cross-boundary-event-parent">cross-boundary event parent<a class="self-link" href="infrastructure.html#cross-boundary-event-parent"></a></dfn></p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/encoding/#encoding">encoding</a> (herein the <i>character encoding</i>) and <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-document-content-type">content type</a> of a <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code></p>
       </li><li data-md="">
        <p>The distinction between <a data-link-type="dfn" href="infrastructure.html#xml-document" id="ref-for-xml-document-3">XML documents</a> and <a data-link-type="dfn" href="infrastructure.html#html-document" id="ref-for-html-document-2">HTML documents</a></p>
       </li><li data-md="">
        <p>The terms <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="quirks-mode">quirks mode</dfn>, <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="limited-quirks-mode">limited-quirks mode</dfn>, and <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="no-quirks-mode">no-quirks mode</dfn></p>
       </li><li data-md="">
        <p>The algorithm to <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-clone">clone</a> a <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#node">Node</a></code>, and the concept of <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-clone">cloning steps</a> used by that algorithm</p>
       </li><li data-md="">
        <p>The concept of <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="base-url-change-steps">base URL change steps</dfn> and the definition of what happens when an
element is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="affected-by-a-base-url-change">affected by a base URL change</dfn></p>
       </li><li data-md="">
        <p>The concept of an element’s <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-id">unique identifier (ID)</a></p>
       </li><li data-md="">
        <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="supported tokens|supported token" data-noexport="" id="supported-tokens">supported tokens</dfn></p>
       </li><li data-md="">
        <p>The concept of a DOM <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-range">range</a>, and the terms <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-range-start">start</a>, <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-range-end">end</a>, and <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-range-bp">boundary point</a> as applied to ranges.</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#mutationobserver">MutationObserver</a></code> interface and <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="mutation-observers">mutation observers</dfn> in
general</p>
      </li></ul>
      <p>The term <a data-link-type="dfn" href="infrastructure.html#throw" id="ref-for-throw-1">throw</a> in this specification is used as defined in the DOM specification.
  The following <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#idl-DOMException">DOMException</a> types are defined in the DOM specification: <a data-link-type="biblio" href="references.html#biblio-dom">[DOM]</a></p>
      <ul>
       <li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#indexsizeerror">IndexSizeError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#wrongdocumenterror">WrongDocumentError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#nomodificationallowederror">NoModificationAllowedError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror">InvalidStateError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="http://www.ecma-international.org/ecma-262/6.0/#sec-native-error-types-used-in-this-standard-syntaxerror">SyntaxError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidmodificationerror">InvalidModificationError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidaccesserror">InvalidAccessError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror">SecurityError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#networkerror">NetworkError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#aborterror">AbortError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#urlmismatcherror">URLMismatchError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#quotaexceedederror">QuotaExceededError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#timeouterror">TimeoutError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#datacloneerror">DataCloneError</a></code></p>
      </li></ul>
      <p class="example" id="example-cc01fb9e"><a class="self-link" href="infrastructure.html#example-cc01fb9e"></a> For example, to <i>throw a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#timeouterror">TimeoutError</a></code> exception</i>, a user agent would
    construct a <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#idl-DOMException">DOMException</a> object whose type was the string
    "<code>TimeoutError</code>" (and whose code was the number 23, for legacy reasons) and
    actually throw that object as an exception. </p>
      <p>The following features are defined in the UI Events specification: <a data-link-type="biblio" href="references.html#biblio-uievents">[UIEVENTS]</a></p>
      <ul>
       <li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/uievents/#interface-MouseEvent">MouseEvent</a></code> interface and the following interface members:</p>
        <ul>
         <li data-md="">
          <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/uievents/#widl-MouseEvent-relatedTarget">relatedTarget</a></code> attribute</p>
         </li><li data-md="">
          <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/uievents/#widl-MouseEvent-button">button</a></code> attribute</p>
         </li><li data-md="">
          <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/uievents/#widl-MouseEvent-ctrlKey">ctrlKey</a></code> attribute</p>
         </li><li data-md="">
          <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/uievents/#widl-MouseEvent-shiftKey">shiftKey</a></code> attribute</p>
         </li><li data-md="">
          <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/uievents/#widl-MouseEvent-altKey">altKey</a></code> attribute</p>
         </li><li data-md="">
          <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/uievents/#widl-MouseEvent-metaKey">metaKey</a></code> attribute</p>
         </li><li data-md="">
          <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/uievents/#widl-MouseEvent-getModifierState">getModifierState()</a></code> method</p>
        </li></ul>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/uievents/#idl-def-MouseEventInit">MouseEventInit</a></code> dictionary type</p>
       </li><li data-md="">
        <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/uievents/#interface-FocusEvent">FocusEvent</a></code> interface and its <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/uievents/#widl-FocusEvent-relatedTarget">relatedTarget</a></code> attribute</p>
       </li><li data-md="">
        <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/uievents/#interface-UIEvent">UIEvent</a></code> interface’s <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/uievents/#widl-UIEvent-view">view</a></code> and <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/uievents/#widl-UIEvent-detail">detail</a></code> attributes</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="event" href="https://www.w3.org/TR/uievents/#event-type-click">click</a> event</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="event" href="https://www.w3.org/TR/uievents/#event-type-dblclick">dblclick</a> event</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="event" href="https://www.w3.org/TR/uievents/#event-type-mousedown">mousedown</a> event</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="event" href="https://www.w3.org/TR/uievents/#event-type-mouseenter">mouseenter</a> event</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="event" href="https://www.w3.org/TR/uievents/#event-type-mouseleave">mouseleave</a> event</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="event" href="https://www.w3.org/TR/uievents/#event-type-mousemove">mousemove</a> event</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="event" href="https://www.w3.org/TR/uievents/#event-type-mouseout">mouseout</a> event</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="event" href="https://www.w3.org/TR/uievents/#event-type-mouseover">mouseover</a> event</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="event" href="https://www.w3.org/TR/uievents/#event-type-mouseup">mouseup</a> event</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="event" href="https://www.w3.org/TR/uievents/#event-type-wheel">wheel</a> event</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="event" href="https://www.w3.org/TR/uievents/#event-type-keydown">keydown</a> event</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="event" href="https://www.w3.org/TR/uievents/#event-type-keyup">keyup</a> event</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="event" href="https://www.w3.org/TR/uievents/#event-type-keypress">keypress</a> event</p>
      </li></ul>
      <p>The following features are defined in the Touch Events specification: <a data-link-type="biblio" href="references.html#biblio-touch-events">[TOUCH-EVENTS]</a></p>
      <ul>
       <li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/touch-events/#idl-def-TouchEvent">Touch</a></code> interface</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/touch-events/#dfn-touch-point">Touch point</a> concept</p>
      </li></ul>
      <p>This specification sometimes uses the term <dfn class="idl-code" data-dfn-for="global" data-dfn-type="event" data-export="" id="eventdef-global-name">name<a class="self-link" href="infrastructure.html#eventdef-global-name"></a></dfn> to refer to the event’s <code>type</code>; as in, "an event named <code>click</code>" or "if the event name is <code>keypress</code>". The terms "name" and "type" for events are synonymous.</p>
      <p>The following features are defined in the DOM Parsing and Serialization specification: <a data-link-type="biblio" href="references.html#biblio-dom-parsing">[DOM-Parsing]</a></p>
      <ul>
       <li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/DOM-Parsing/#widl-Element-innerHTML">innerHTML</a></code></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/DOM-Parsing/#widl-Element-outerHTML">outerHTML</a></code></p>
      </li></ul>
      <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/selection-api/#idl-def-Selection">Selection</a></code> interface is defined in the <cite>Selection API</cite> specification. <a data-link-type="biblio" href="references.html#biblio-selection-api">[SELECTION-API]</a></p>
      <p class="note" role="note"> User agents are also encouraged to implement the features described in the <cite>HTML Editing APIs</cite> and <cite><code>UndoManager</code> and DOM Transaction</cite> specifications. <a data-link-type="biblio" href="references.html#biblio-editing">[EDITING]</a> <a data-link-type="biblio" href="references.html#biblio-undo">[UNDO]</a> </p>
      <p>The following parts of the Fullscreen specification are referenced from this specification, in
  part to define the rendering of <code><a data-link-type="element" href="interactive-elements.html#elementdef-dialog" id="ref-for-elementdef-dialog-1">dialog</a></code> elements, and also to define how the
  Fullscreen API interacts with the sandboxing features in HTML: <a data-link-type="biblio" href="references.html#biblio-fullscreen">[FULLSCREEN]</a></p>
      <ul>
       <li data-md="">
        <p>The <a data-link-type="dfn" href="https://fullscreen.spec.whatwg.org/#top-layer">top layer</a> concept</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://fullscreen.spec.whatwg.org/#dom-element-requestfullscreen">requestFullscreen()</a></code></p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://fullscreen.spec.whatwg.org/#fullscreen-enabled-flag">fullscreen enabled flag</a></p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://fullscreen.spec.whatwg.org/#fully-exit-fullscreen">fully exit fullscreen</a> algorithm</p>
      </li></ul>
      <p>The <cite>High Resolution Time</cite> specification provides the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/hr-time/#dom-domhighrestimestamp">DOMHighResTimeStamp</a></code> typedef and the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/hr-time/#the-performance-interface">Performance</a></code> object’s <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/hr-time/#dom-performance-now">now()</a></code> method. <a data-link-type="biblio" href="references.html#biblio-hr-time-2">[HR-TIME-2]</a></p>
     </dd><dt data-md="">
      <p>File API</p>
     </dt><dd data-md="">
      <p>This specification uses the following features defined in the File API specification: <a data-link-type="biblio" href="references.html#biblio-fileapi">[FILEAPI]</a></p>
      <ul>
       <li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/FileAPI/#dfn-Blob">Blob</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/FileAPI/#dfn-file">File</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/FileAPI/#dfn-filelist">FileList</a></code> interface</p>
       </li><li data-md="">
        <p>The concept of a <a data-link-type="dfn" href="https://www.w3.org/TR/FileAPI/#closed">closed</a> <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/FileAPI/#dfn-Blob">Blob</a></code></p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="attribute" href="https://www.w3.org/TR/FileAPI/#dfn-type"><code>Blob.type</code></a></p>
       </li><li data-md="">
        <p>The concept of <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="error occurs during reading of the object|read errors" data-noexport="" id="error-occurs-during-reading-of-the-object">read errors</dfn></p>
      </li></ul>
     </dd><dt data-md="">
      <p>Media Source Extensions</p>
     </dt><dd data-md="">
      <p>The following terms are defined in the Media Source Extensions specification: <a data-link-type="biblio" href="references.html#biblio-media-source">[MEDIA-SOURCE]</a></p>
      <ul>
       <li data-md="">
        <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="detach from a media element" data-noexport="" id="detach-from-a-media-element">Detaching from a media element</dfn></p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://w3c.github.io/media-source/#idl-def-MediaSource">MediaSource</a></code> <a data-link-type="biblio" href="references.html#biblio-media-source">[MEDIA-SOURCE]</a></p>
      </li></ul>
     </dd><dt data-md="">
      <p>Media Capture and Streams</p>
     </dt><dd data-md="">
      <p>The following term is defined in the Media Capture and Streams specification: <a data-link-type="biblio" href="references.html#biblio-mediacapture-streams">[MEDIACAPTURE-STREAMS]</a></p>
      <ul>
       <li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/mediacapture-streams/#idl-def-MediaStream">MediaStream</a></code> <a data-link-type="biblio" href="references.html#biblio-mediacapture-streams">[MEDIACAPTURE-STREAMS]</a></p>
      </li></ul>
     </dd><dt data-md="">
      <p>XMLHttpRequest</p>
     </dt><dd data-md="">
      <p>This specification references the XMLHttpRequest specification to describe how the two
  specifications interact. The following
  features and terms are defined in the XMLHttpRequest specification: <a data-link-type="biblio" href="references.html#biblio-xhr">[XHR]</a></p>
      <ul>
       <li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://xhr.spec.whatwg.org/#interface-xmlhttprequest">XMLHttpRequest</a></code> interface</p>
       </li><li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://xhr.spec.whatwg.org/#the-responsexml-attribute">XMLHttpRequest.responseXML</a></code> attribute</p>
      </li></ul>
     </dd><dt data-md="">
      <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/progress-events/#interface-progressevent">ProgressEvent</a></code></p>
     </dt><dd data-md="">
      <p>This specification references the Progress Events specification to describe how the two
  specifications interact and to use its <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/progress-events/#interface-progressevent">ProgressEvent</a></code> feature. The following
  feature are defined in the Progress Events specification: <a data-link-type="biblio" href="references.html#biblio-progress-events">[PROGRESS-EVENTS]</a></p>
      <ul>
       <li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/progress-events/#interface-progressevent">ProgressEvent</a></code> interface</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="attribute" href="https://www.w3.org/TR/progress-events/#dom-progressevent-lengthcomputable"><code>ProgressEvent.lengthComputable</code></a> attribute</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="attribute" href="https://www.w3.org/TR/progress-events/#dom-progressevent-loaded"><code>ProgressEvent.loaded</code></a> attribute</p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="attribute" href="https://www.w3.org/TR/progress-events/#dom-progressevent-total"><code>ProgressEvent.total</code></a> attribute</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/progress-events/#concept-event-fire-progress">Fire a progress event named <var>e</var></a></p>
      </li></ul>
     </dd><dt data-md="">
      <p>Server-Sent Events</p>
     </dt><dd data-md="">
      <p>This specification references <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/eventsource/#eventsource">EventSource</a></code> which is specified in the
  Server-Sent Events specification <a data-link-type="biblio" href="references.html#biblio-eventsource">[EVENTSOURCE]</a></p>
     </dd><dt data-md="">
      <p>Media Queries</p>
     </dt><dd data-md="">
      <p>Implementations must support the Media Queries language. <a data-link-type="biblio" href="references.html#biblio-mediaq">[MEDIAQ]</a></p>
     </dd><dt data-md="">
      <p>CSS modules</p>
     </dt><dd data-md="">
      <p>While support for CSS as a whole is not required of implementations of this specification
  (though it is encouraged, at least for Web browsers), some features are defined in terms of
  specific CSS requirements.</p>
      <p>In particular, some features require that a string be <dfn data-dfn-type="dfn" data-noexport="" id="parsed-as-a-css-color-value">parsed as a CSS &lt;color&gt; value<a class="self-link" href="infrastructure.html#parsed-as-a-css-color-value"></a></dfn>. When parsing a CSS value, user agents are
  required by the CSS specifications to apply some error handling rules. These apply to this
  specification also. <a data-link-type="biblio" href="references.html#biblio-css3color">[CSS3COLOR]</a> <a data-link-type="biblio" href="references.html#biblio-css-2015">[CSS-2015]</a></p>
      <p class="example" id="example-1b106b1b"><a class="self-link" href="infrastructure.html#example-1b106b1b"></a> For example, user agents are required to close all open constructs upon finding the end of a
    style sheet unexpectedly. Thus, when parsing the string "<code>rgb(0,0,0</code>" (with a
    missing close-parenthesis) for a color value, the close parenthesis is implied by this error
    handling rule, and a value is obtained (the color <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-color-4/#valdef-color-black">black</a>). However, the similar construct
    "<code>rgb(0,0,</code>" (with both a missing parenthesis and a missing "blue" value) cannot
    be parsed, as closing the open construct does not result in a viable value. </p>
      <p>The following terms and features are defined in the CSS specification: <a data-link-type="biblio" href="references.html#biblio-css-2015">[CSS-2015]</a></p>
      <ul>
       <li data-md="">
        <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="viewport">viewport</dfn></p>
       </li><li data-md="">
        <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="replaced-element">replaced element</dfn></p>
       </li><li data-md="">
        <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="intrinsic-dimensions">intrinsic dimensions</dfn></p>
      </li></ul>
      <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="named color|named colors" data-noexport="" id="named-color">named color</dfn> is defined in the CSS Color specification. <a data-link-type="biblio" href="references.html#biblio-css3color">[CSS3COLOR]</a></p>
      <p>The terms <dfn class="dfn-paneled" data-dfn-for="css" data-dfn-type="dfn" data-noexport="" id="css-intrinsic-width">intrinsic width</dfn> and <dfn class="dfn-paneled" data-dfn-for="css" data-dfn-type="dfn" data-noexport="" id="css-intrinsic-height">intrinsic height</dfn> refer to the width
  dimension and the height dimension, respectively, of <a data-link-type="dfn" href="infrastructure.html#intrinsic-dimensions" id="ref-for-intrinsic-dimensions-1">intrinsic dimensions</a>.</p>
      <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="provides-a-paint-source">provides a paint source</dfn> is used as defined in the <cite>CSS Image Values and Replaced Content</cite> specification to define the interaction of
  certain HTML elements with the CSS 'element()' function. <a data-link-type="biblio" href="references.html#biblio-css3-images">[CSS3-IMAGES]</a></p>
      <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="default-object-size">default object size</dfn> is also defined in the <cite>CSS Image Values and Replaced Content</cite> specification. <a data-link-type="biblio" href="references.html#biblio-css3-images">[CSS3-IMAGES]</a></p>
      <p>Implementations that support scripting must support the CSS Object Model. The following
  features and terms are defined in the CSSOM specifications: <a data-link-type="biblio" href="references.html#biblio-cssom">[CSSOM]</a> <a data-link-type="biblio" href="references.html#biblio-cssom-view">[CSSOM-VIEW]</a></p>
      <ul>
       <li data-md="">
        <p><a class="idl-code" data-link-type="interface" href="https://www.w3.org/TR/cssom-view/#screen"><code>Screen</code></a></p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="interface" href="https://www.w3.org/TR/cssom-1/#linkstyle"><code>LinkStyle</code></a></p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="interface" href="https://www.w3.org/TR/cssom-1/#cssstyledeclaration"><code>CSSStyleDeclaration</code></a></p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="attribute" href="https://www.w3.org/TR/cssom-1/#dom-cssstyledeclaration-csstext"><code>cssText</code></a> attribute of <a class="idl-code" data-link-type="interface" href="https://www.w3.org/TR/cssom-1/#cssstyledeclaration"><code>CSSStyleDeclaration</code></a></p>
       </li><li data-md="">
        <p><a class="idl-code" data-link-type="interface" href="https://www.w3.org/TR/cssom-1/#stylesheet"><code>StyleSheet</code></a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/cssom-1/#create-a-css-style-sheet">create a CSS style sheet</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/cssom-1/#remove-a-css-style-sheet">remove a CSS style sheet</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/cssom-1/#associated-css-style-sheet">associated CSS style sheet</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/cssom-1/#css-style-sheet">CSS style sheets</a> and their properties: <a data-link-type="dfn" href="https://drafts.csswg.org/cssom/#dom-stylesheet-type">type</a>, <a data-link-type="dfn" href="https://www.w3.org/TR/cssom-1/#concept-css-style-sheet-location">location</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/cssom/#dom-stylesheet-parentstylesheet">parent CSS style sheet</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/cssom/#dom-stylesheet-ownernode">owner node</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/cssom/#dom-cssstylesheet-ownerrule">owner CSS rule</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/cssom/#dom-stylesheet-media">media</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/cssom/#dom-stylesheet-title">title</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/cssom/#concept-css-style-sheet-alternate-flag">alternate flag</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/cssom/#concept-css-style-sheet-disabled-flag">disabled flag</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/cssom/#concept-css-style-sheet-css-rules">CSS rules</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/cssom/#concept-css-style-sheet-origin-clean-flag">origin-clean flag</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://drafts.csswg.org/cssom/#enabled-css-style-sheet-set">Alternative style sheet sets</a> and the <a data-link-type="dfn" href="https://drafts.csswg.org/cssom/#enabled-css-style-sheet-set">preferred style sheet set</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://drafts.csswg.org/cssom/#serializing-css-values">Serializing a CSS value</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/cssom-view-1/#run-the-resize-steps">run the resize steps</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/cssom-view-1/#run-the-scroll-steps">run the scroll steps</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/cssom-view-1/#evaluate-media-queries-and-report-changes">evaluate media queries and report changes</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/cssom-view/#scroll-an-element-into-view">Scroll an element into view</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/cssom-view/#scroll-to-the-beginning-of-the-document">Scroll to the beginning of the document</a></p>
       </li><li data-md="">
        <p>The <a class="idl-code" data-link-type="event" href="https://www.w3.org/TR/cssom-view-1/#eventdef-window-resize"><code>resize</code></a> event</p>
       </li><li data-md="">
        <p>The <a class="idl-code" data-link-type="event" href="https://www.w3.org/TR/cssom-view-1/#eventdef-document-scroll"><code>scroll</code></a> event</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/cssom-view-1/#the-features-argument-to-the-open()-method">The <em>features</em> argument of <code>window.open</code></a></p>
      </li></ul>
      <p>The following features and terms are defined in the <cite>CSS Syntax</cite> specifications: <a data-link-type="biblio" href="references.html#biblio-css-syntax-3">[CSS-SYNTAX-3]</a></p>
      <ul>
       <li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/css3-syntax/#consume-a-component-value">Parse a comma-separated list of component values</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/css3-syntax/#component-value">component value</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/css3-syntax/#environment-encoding">environment encoding</a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="type" href="https://www.w3.org/TR/css3-syntax/#typedef-whitespace-token">&lt;whitespace-token&gt;</a></p>
      </li></ul>
      <p>The feature <a class="css" data-link-type="type" href="https://www.w3.org/TR/css3-values/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm">&lt;length&gt;</a> is defined in the <cite>CSS Values and Units</cite> specification. <a data-link-type="biblio" href="references.html#biblio-css-values">[CSS-VALUES]</a></p>
      <p>The term <a data-link-type="dfn" href="https://www.w3.org/TR/css-style-attr/#syntax">CSS styling attribute</a> is defined in the <cite>CSS Style Attributes</cite> specification. <a data-link-type="biblio" href="references.html#biblio-css-style-attr">[CSS-STYLE-ATTR]</a></p>
      <p>The <code>CanvasRenderingContext2D</code> object’s use of fonts depends on the features
  described in the CSS <cite>Fonts</cite> and <cite>Font Loading</cite> specifications,
  including in particular <a class="idl-code" data-link-type="interface" href="https://www.w3.org/TR/css-font-loading-3/#dom-fontface"><code>FontFace</code></a> objects and the <a data-link-type="dfn" href="https://www.w3.org/TR/css-font-loading-3/#font-source">font source</a> concept. <a data-link-type="biblio" href="references.html#biblio-css-fonts-3">[CSS-FONTS-3]</a> <a data-link-type="biblio" href="references.html#biblio-css-font-loading-3">[CSS-FONT-LOADING-3]</a></p>
      <p>The following interface is defined in the Geometry Interfaces Module specification: <a data-link-type="biblio" href="references.html#biblio-geometry-1">[GEOMETRY-1]</a></p>
      <ul>
       <li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/geometry-1/#dom-dommatrix">DOMMatrix</a></code> interface</p>
      </li></ul>
     </dd><dt data-md="">
      <p>SVG</p>
     </dt><dd data-md="">
      <p>The <code>CanvasRenderingContext2D</code> object’s use of fonts depends on the features
  described in the CSS <cite>Fonts</cite> and <cite>Font Loading</cite> specifications,
  including in particular <a class="idl-code" data-link-type="interface" href="https://www.w3.org/TR/css-font-loading-3/#dom-fontface"><code>FontFace</code></a> objects and the <a data-link-type="dfn" href="https://www.w3.org/TR/css-font-loading-3/#font-source">font source</a> concept. <a data-link-type="biblio" href="references.html#biblio-css-fonts-3">[CSS-FONTS-3]</a> <a data-link-type="biblio" href="references.html#biblio-css-font-loading-3">[CSS-FONT-LOADING-3]</a></p>
      <p>The following interface is defined in the SVG specification: <a data-link-type="biblio" href="references.html#biblio-svg11">[SVG11]</a></p>
      <ul>
       <li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/SVG/coords.html#InterfaceSVGMatrix">SVGMatrix</a></code></p>
      </li></ul>
     </dd><dt data-md="">
      <p>WebGL</p>
     </dt><dd data-md="">
      <p>The following interface is defined in the WebGL specification: <a data-link-type="biblio" href="references.html#biblio-webgl">[WEBGL]</a></p>
      <ul>
       <li data-md="">
        <p><code class="idl"><a data-link-type="idl" href="https://www.khronos.org/registry/webgl/specs/1.0/#WEBGLRENDERINGCONTEXT">WebGLRenderingContext</a></code></p>
      </li></ul>
     </dd><dt data-md="">
      <p>WebVTT</p>
     </dt><dd data-md="">
      <p>Implementations may support <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="webvtt">WebVTT</dfn> as a text track format for subtitles, captions,
  chapter titles, metadata, etc, for media resources. <a data-link-type="biblio" href="references.html#biblio-webvtt">[WEBVTT]</a></p>
      <p>The following terms, used in this specification, are defined in the WebVTT specification:</p>
      <ul>
       <li data-md="">
        <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="webvtt-file">WebVTT file</dfn></p>
       </li><li data-md="">
        <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="webvtt-file-using-cue-text">WebVTT file using cue text</dfn></p>
       </li><li data-md="">
        <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="webvtt-file-using-chapter-title-text">WebVTT file using chapter title text</dfn></p>
       </li><li data-md="">
        <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="webvtt-file-using-only-nested-cues">WebVTT file using only nested cues</dfn></p>
       </li><li data-md="">
        <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="webvtt-parser">WebVTT parser</dfn></p>
       </li><li data-md="">
        <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="rules-for-updating-the-display-of-webvtt-text-tracks">rules for updating the display of WebVTT text tracks</dfn></p>
       </li><li data-md="">
        <p>The <dfn data-dfn-type="dfn" data-noexport="" id="rules-for-interpreting-webvtt-cue-text">rules for interpreting WebVTT cue text<a class="self-link" href="infrastructure.html#rules-for-interpreting-webvtt-cue-text"></a></dfn></p>
       </li><li data-md="">
        <p>The WebVTT <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="text-track-cue-writing-direction">text track cue writing direction</dfn></p>
      </li></ul>
     </dd><dt data-md="">
      <p>The WebSocket protocol</p>
     </dt><dd data-md="">
      <p>The following terms are defined in the WebSocket protocol specification: <a data-link-type="biblio" href="references.html#biblio-rfc6455">[RFC6455]</a></p>
      <ul>
       <li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="establish-a-websocket-connection">establish a WebSocket connection<a class="self-link" href="infrastructure.html#establish-a-websocket-connection"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="the-websocket-connection-is-established">the WebSocket connection is established<a class="self-link" href="infrastructure.html#the-websocket-connection-is-established"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="validate-the-servers-response">validate the server’s response<a class="self-link" href="infrastructure.html#validate-the-servers-response"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="extensions-in-use">extensions in use<a class="self-link" href="infrastructure.html#extensions-in-use"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="subprotocol-in-use">subprotocol in use<a class="self-link" href="infrastructure.html#subprotocol-in-use"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="headers-to-send-appropriate-cookies">headers to send appropriate cookies<a class="self-link" href="infrastructure.html#headers-to-send-appropriate-cookies"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="cookies-set-during-the-servers-opening-handshake">cookies set during the server’s opening handshake<a class="self-link" href="infrastructure.html#cookies-set-during-the-servers-opening-handshake"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="a-websocket-message-has-been-received">a WebSocket message has been received<a class="self-link" href="infrastructure.html#a-websocket-message-has-been-received"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="send-a-websocket-message">send a WebSocket Message<a class="self-link" href="infrastructure.html#send-a-websocket-message"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="fail-the-websocket-connection">fail the WebSocket connection<a class="self-link" href="infrastructure.html#fail-the-websocket-connection"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="close-the-websocket-connection">close the WebSocket connection<a class="self-link" href="infrastructure.html#close-the-websocket-connection"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="start-the-websocket-closing-handshake">start the WebSocket closing handshake<a class="self-link" href="infrastructure.html#start-the-websocket-closing-handshake"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="the-websocket-closing-handshake-is-started">the WebSocket closing handshake is started<a class="self-link" href="infrastructure.html#the-websocket-closing-handshake-is-started"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="the-websocket-connection-is-closed">the WebSocket connection is closed<a class="self-link" href="infrastructure.html#the-websocket-connection-is-closed"></a></dfn> (possibly <i>cleanly</i>)</p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="the-websocket-connection-close-code">the WebSocket connection close code<a class="self-link" href="infrastructure.html#the-websocket-connection-close-code"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="the-websocket-connection-close-reason">the WebSocket connection close reason<a class="self-link" href="infrastructure.html#the-websocket-connection-close-reason"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-type="dfn" data-noexport="" id="sec-websocket-protocol"><code>Sec-WebSocket-Protocol</code><a class="self-link" href="infrastructure.html#sec-websocket-protocol"></a></dfn> field</p>
      </li></ul>
     </dd><dt data-md="">
      <p>ARIA</p>
     </dt><dd data-md="">
      <p>The <dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-role"><code>role</code><a class="self-link" href="infrastructure.html#element-attrdef-global-role"></a></dfn> attribute is defined in the ARIA specification, as are the
  following roles: <a data-link-type="biblio" href="references.html#biblio-wai-aria">[WAI-ARIA]</a></p>
      <ul>
       <li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#alert"><code>alert</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#alertdialog"><code>alertdialog</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#application"><code>application</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#article"><code>article</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#banner"><code>banner</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#button"><code>button</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#checkbox"><code>checkbox</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#columnheader"><code>columnheader</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#combobox"><code>combobox</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#complementary"><code>complementary</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#contentinfo"><code>contentinfo</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#dialog"><code>dialog</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#directory"><code>directory</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#document"><code>document</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#grid"><code>grid</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#gridcell"><code>gridcell</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#group"><code>group</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#heading"><code>heading</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#img"><code>img</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#link"><code>link</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#list"><code>list</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#listbox"><code>listbox</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#listitem"><code>listitem</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#log"><code>log</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#main"><code>main</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#marquee"><code>marquee</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#menu"><code>menu</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#menubar"><code>menubar</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#menuitem"><code>menuitem</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#menuitemcheckbox"><code>menuitemcheckbox</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#menuitemradio"><code>menuitemradio</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#navigation"><code>navigation</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#note"><code>note</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#option"><code>option</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#presentation"><code>presentation</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#progressbar"><code>progressbar</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#radio"><code>radio</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#region"><code>region</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#row"><code>row</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#rowgroup"><code>rowgroup</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#rowheader"><code>rowheader</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#search"><code>search</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#separator"><code>separator</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#slider"><code>slider</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#spinbutton"><code>spinbutton</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#status"><code>status</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#tab"><code>tab</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#tablist"><code>tablist</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#textbox"><code>textbox</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#toolbar"><code>toolbar</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#tree"><code>tree</code></a></p>
       </li><li data-md="">
        <p><a class="css" data-link-type="value" href="https://www.w3.org/TR/wai-aria/roles#treeitem"><code>treeitem</code></a></p>
      </li></ul>
      <p>In addition, the following <dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria"><code>aria-*</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria"></a></dfn> content attributes are defined in
  the ARIA specification: <a data-link-type="biblio" href="references.html#biblio-wai-aria">[WAI-ARIA]</a></p>
      <ul>
       <li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-checked"><code>aria-checked</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-checked"></a></dfn></p>
       </li><li data-md="">
        <p><dfn class="dfn-paneled" data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-describedby"><code>aria-describedby</code></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-disabled"><code>aria-disabled</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-disabled"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-expanded"><code>aria-expanded</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-expanded"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-hidden"><code>aria-hidden</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-hidden"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-invalid"><code>aria-invalid</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-invalid"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-label"><code>aria-label</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-label"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-level"><code>aria-level</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-level"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-multiline"><code>aria-multiline</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-multiline"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-multiselectable"><code>aria-multiselectable</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-multiselectable"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-owns"><code>aria-owns</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-owns"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-readonly"><code>aria-readonly</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-readonly"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-required"><code>aria-required</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-required"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-selected"><code>aria-selected</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-selected"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-sort"><code>aria-sort</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-sort"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-valuemax"><code>aria-valuemax</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-valuemax"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-valuemin"><code>aria-valuemin</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-valuemin"></a></dfn></p>
       </li><li data-md="">
        <p><dfn data-dfn-for="global" data-dfn-type="element-attr" data-export="" id="element-attrdef-global-aria-valuenow"><code>aria-valuenow</code><a class="self-link" href="infrastructure.html#element-attrdef-global-aria-valuenow"></a></dfn></p>
      </li></ul>
     </dd><dt data-md="">
      <p>Content Security Policy</p>
     </dt><dd data-md="">
      <p>The following terms are defined in <cite>Content Security Policy</cite>: <a data-link-type="biblio" href="references.html#biblio-csp3">[CSP3]</a></p>
      <ul>
       <li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/CSP3/#policy">Content Security Policy</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/CSP3/#directives">Content Security Policy directive</a></p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/CSP3/#grammardef-serialized-policy">Content Security Policy syntax</a></p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="https://www.w3.org/TR/CSP3/#enforced">enforce the policy</a></p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/CSP3/#parse-serialized-policy">parse a serialized Content Security Policy</a> algorithm</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/CSP3/#initialize-global-object-csp">Initialize a global object’s CSP list</a> algorithm</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/CSP3/#initialize-document-csp">Initialize a Document’s CSP list</a> algorithm</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/CSP3/#should-block-inline">Should element’s inline behavior be blocked by Content Security Policy?</a> algorithm</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/CSP3/#report-uri"><code>report-uri</code></a>, <a data-link-type="dfn" href="https://w3c.github.io/webappsec-csp/#frame-ancestors"><code>frame-ancestors</code></a>, and <a data-link-type="dfn" href="https://www.w3.org/TR/CSP/#directive-sandbox"><code>sandbox</code></a> <a data-link-type="dfn" href="https://www.w3.org/TR/CSP3/#directives">directives</a></p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/CSP3/#can-compile-strings">EnsureCSPDoesNotBlockStringCompilation</a> abstract algorithm</p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://w3c.github.io/webappsec-csp/#allow-base-for-document">Is base allowed for Document?</a> algorithm</p>
      </li></ul>
     </dd><dd data-md="">
      <p>The following terms are defined in <cite>Content Security Policy: Document Features </cite></p>
      <ul>
       <li data-md="">
        <p>The <a data-link-type="dfn" href="https://w3c.github.io/webappsec-csp/#frame-ancestors"><code>frame-ancestors</code> directive</a></p>
       </li><li data-md="">
        <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/CSP/#directive-sandbox"><code>sandbox</code> directive</a></p>
      </li></ul>
     </dd><dt data-md="">
      <p>Service Workers</p>
     </dt><dd data-md="">
      <p>The following terms are defined in <cite>Service Workers</cite>: <a data-link-type="biblio" href="references.html#biblio-service-workers">[SERVICE-WORKERS]</a></p>
      <ul>
       <li data-md="">
        <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="match-service-worker-registration">match service worker registration</dfn></p>
      </li></ul>
    </dd></dl>
    <p>This specification does not <em>require</em> support of any particular network protocol, style
  sheet language, scripting language, or any of the DOM specifications beyond those required in the
  list above. However, the language described by this specification is biased towards CSS as the
  styling language, JavaScript as the scripting language, and HTTP as the network protocol, and
  several features assume that those languages and protocols are in use.</p>
    <p>A user agent that implements the HTTP protocol must implement the Web Origin Concept
  specification and the HTTP State Management Mechanism specification (Cookies) as well. <a data-link-type="biblio" href="references.html#biblio-http">[HTTP]</a> <a data-link-type="biblio" href="references.html#biblio-origin">[ORIGIN]</a> <a data-link-type="biblio" href="references.html#biblio-cookies">[COOKIES]</a></p>
    <p class="note" role="note"> This specification might have certain additional requirements on character encodings, image
    formats, audio formats, and video formats in the respective sections. </p>
    <h4 class="heading settled" data-level="2.2.3" id="conformance-requirements-extensibility"><span class="secno">2.2.3. </span><span class="content">Extensibility</span><a class="self-link" href="infrastructure.html#conformance-requirements-extensibility"></a></h4>
    <p>Vendor-specific proprietary user agent extensions to this specification are strongly discouraged.
  Documents must not use such extensions, as doing so reduces interoperability and fragments the
  user base, allowing only users of specific user agents to access the content in question.</p>
    <p>If such extensions are nonetheless needed, e.g., for experimental purposes, then vendors are
  strongly urged to use one of the following extension mechanisms:</p>
    <ul>
     <li data-md="">
      <p>For markup-level features that can be limited to the XML serialization and need not be
supported in the HTML serialization, vendors should use the namespace mechanism to define
custom namespaces in which the non-standard elements and attributes are supported.</p>
     </li><li data-md="">
      <p>For markup-level features that are intended for use with <a href="syntax.html#syntax">the HTML syntax</a>,
extensions should be limited to new attributes of the form
"<code>x-<var>vendor</var>-<var>feature</var></code>", where <var>vendor</var> is a short
string that identifies the vendor responsible for the extension, and <var>feature</var> is
the name of the feature. New element names should not be created. Using attributes for such
extensions exclusively allows extensions from multiple vendors to co-exist on the same
element, which would not be possible with elements. Using the
"<code>x-<var>vendor</var>-<var>feature</var></code>" form allows extensions to be made
without risk of conflicting with future additions to the specification.</p>
      <div class="example" id="example-16caa218">
       <a class="self-link" href="infrastructure.html#example-16caa218"></a> For instance, a browser named "FerretBrowser" could use "ferret" as a vendor prefix,
  while a browser named "Mellblom Browser" could use "mb". If both of these browsers
  invented extensions that turned elements into scratch-and-sniff areas, an author
  experimenting with these features could write: 
<pre class="highlight"><span class="nt">&lt;p&gt;</span>This smells of lemons!
<span class="nt">&lt;span</span> <span class="na">x-ferret-smellovision</span> <span class="na">x-ferret-smellcode=</span><span class="s">"LEM01"</span>
<span class="na">x-mb-outputsmell</span> <span class="na">x-mb-smell=</span><span class="s">"lemon juice"</span><span class="nt">&gt;&lt;/span&gt;&lt;/p&gt;</span>
</pre>
      </div>
    </li></ul>
    <p>Attribute names beginning with the two characters "<code>x-</code>" are reserved for
  user agent use and are guaranteed to never be formally added to the HTML language. For
  flexibility, attributes names containing underscores (the U+005F LOW LINE character) are also
  reserved for experimental purposes and are guaranteed to never be formally added to the HTML
  language.</p>
    <p class="note" role="note">Pages that use such attributes are by definition non-conforming.</p>
    <p>For DOM extensions, e.g., new methods and IDL attributes, the new members should be prefixed by
  vendor-specific strings to prevent clashes with future versions of this specification.</p>
    <p>For events, experimental event types should be prefixed with vendor-specific strings.</p>
    <div class="example" id="example-04787725"><a class="self-link" href="infrastructure.html#example-04787725"></a> For example, if a user agent called "Pleasold" were to add an event to indicate when
    the user is going up in an elevator, it could use the prefix "<code>pleasold</code>" and
    thus name the event "<code>pleasoldgoingup</code>", possibly with an event handler attribute
    named "<code>onpleasoldgoingup</code>". </div>
    <p>All extensions must be defined so that the use of extensions neither contradicts nor causes the
  non-conformance of functionality defined in the specification.</p>
    <div class="example" id="example-c6952ff2"><a class="self-link" href="infrastructure.html#example-c6952ff2"></a> For example, while strongly discouraged from doing so, an implementation "Foo Browser" could
    add a new IDL attribute "<code>fooTypeTime</code>" to a control’s DOM interface that returned
    the time it took the user to select the current value of a control (say). On the other hand,
    defining a new control that appears in a form’s <code>elements</code> array would be in
    violation of the above requirement, as it would violate the definition of <code>elements</code> given in this specification. </div>
    <p>When adding new <a data-link-type="dfn" href="infrastructure.html#reflection" id="ref-for-reflection-1">reflecting</a> IDL attributes corresponding to content attributes of the form
  "<code>x-<var>vendor</var>-<var>feature</var></code>", the IDL attribute should be named
  "<code><var>vendor</var><var>Feature</var></code>" (i.e., the "<code>x</code>" is dropped from
  the IDL attribute’s name).</p>
    <hr>
    <p>When vendor-neutral extensions to this specification are needed, either this specification can be
  updated accordingly, or an extension specification can be written that overrides the requirements
  in this specification. When someone applying this specification to their activities decides that
  they will recognize the requirements of such an extension specification, it becomes an <a data-link-type="dfn" href="infrastructure.html#applicable-specification" id="ref-for-applicable-specification-1">applicable specification</a> for the purposes of conformance requirements in this
  specification.</p>
    <p class="note" role="note"> Someone could write a specification that defines any arbitrary byte stream as conforming, and
    then claim that their random junk is conforming. However, that does not mean that their random
    junk actually is conforming for everyone’s purposes: if someone else decides that the
    specification does not apply to their work, then they can quite legitimately say that the
    aforementioned random junk is just that, junk, and not conforming at all. As far as conformance
    goes, what matters in a particular community is what that community <em>agrees</em> is
    applicable. </p>
    <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="applicable-specification">applicable specification</dfn>.</p>
    <p>The conformance terminology for documents depends on the nature of the changes introduced by such
  applicable specifications, and on the content and intended interpretation of the document.
  Applicable specifications MAY define new document content (e.g., a foobar element), MAY prohibit
  certain otherwise conforming content (e.g., prohibit use of &lt;table&gt;s), or MAY change the
  semantics, DOM mappings, or other processing rules for content defined in this specification.
  Whether a document is or is not a <a data-link-type="dfn" href="infrastructure.html#conforming-document" id="ref-for-conforming-document-3">conforming HTML document</a> does not depend on the use of
  applicable specifications: if the syntax and semantics of a given <a data-link-type="dfn" href="infrastructure.html#conforming-document" id="ref-for-conforming-document-4">conforming HTML document</a> is unchanged by the use of applicable specification(s), then that document remains a <a data-link-type="dfn" href="infrastructure.html#conforming-document" id="ref-for-conforming-document-5">conforming HTML document</a>. If the semantics or processing of a given (otherwise conforming)
  document is changed by use of applicable specification(s), then it is not a <a data-link-type="dfn" href="infrastructure.html#conforming-document" id="ref-for-conforming-document-6">conforming HTML document</a>. For such cases, the applicable specifications SHOULD define
  conformance terminology.</p>
    <p class="note" role="note"> As a suggested but not required convention, such specifications might define conformance
    terminology such as: "Conforming HTML+XXX document", where XXX is a short name
    for the applicable specification. (Example: "Conforming HTML+AutomotiveExtensions document"). </p>
    <p class="note" role="note">a consequence of the rule given above is that certain syntactically correct HTML
    documents may not be <a data-link-type="dfn" href="infrastructure.html#conforming-document" id="ref-for-conforming-document-7">conforming HTML documents</a> in the presence of applicable
    specifications. (Example: the applicable specification defines &lt;table&gt; to be a piece of
    furniture — a document written to that specification and containing a &lt;table&gt; element
    is NOT a <a data-link-type="dfn" href="infrastructure.html#conforming-document" id="ref-for-conforming-document-8">conforming HTML document</a>, even if the element happens to be syntactically
    correct HTML.) </p>
    <hr>
    <p>User agents must treat elements and attributes that they do not understand as semantically
  neutral; leaving them in the DOM (for DOM processors), and styling them according to CSS (for CSS
  processors), but not inferring any meaning from them.</p>
    <p>When support for a feature is disabled (e.g., as an emergency measure to mitigate a security
  problem, or to aid in development, or for performance reasons), user agents must act as if they
  had no support for the feature whatsoever, and as if the feature was not mentioned in this
  specification. For example, if a particular feature is accessed via an attribute in a Web IDL
  interface, the attribute itself would be omitted from the objects that implement that interface
  — leaving the attribute on the object but making it return null or throw an exception is
  insufficient.</p>
    <h4 class="heading settled" data-level="2.2.4" id="interactions-with-xpath-and-xslt"><span class="secno">2.2.4. </span><span class="content">Interactions with XPath and XSLT</span><a class="self-link" href="infrastructure.html#interactions-with-xpath-and-xslt"></a></h4>
    <p>Implementations of XPath 1.0 that operate on <a data-link-type="dfn" href="infrastructure.html#html-document" id="ref-for-html-document-3">HTML documents</a> parsed or created in the
  manners described in this specification (e.g., as part of the <code>document.evaluate()</code> API)
  must act as if the following edit was applied to the XPath 1.0 specification.</p>
    <p>First, remove this paragraph:</p>
    <blockquote cite="https://www.w3.org/TR/1999/REC-xpath-19991116#node-tests"> A <a data-link-type="dfn" href="https://www.w3.org/TR/REC-xml-names#NT-QName">QName</a> in the node test is expanded into an <a data-link-type="dfn" href="https://www.w3.org/TR/1999/REC-xpath-19991116#dt-expanded-name">expanded-name</a> using the namespace
    declarations from the expression context. This is the same way expansion is done for element
    type names in start and end-tags except that the default namespace declared with <code>xmlns</code> is not used: if the <a data-link-type="dfn" href="https://www.w3.org/TR/REC-xml-names#NT-QName">QName</a> does not have a prefix, then the namespace
    URI is null (this is the same way attribute names are expanded). It is an error if the <a data-link-type="dfn" href="https://www.w3.org/TR/REC-xml-names#NT-QName">QName</a> has a prefix for which there is no namespace declaration in the expression context. </blockquote>
    <p>Then, insert in its place the following:</p>
    <blockquote cite="https://www.w3.org/Bugs/Public/show_bug.cgi?id=7059#c37">
      A QName in the node test is expanded into an expanded-name using the namespace declarations from
    the expression context. If the QName has a prefix, then there must be a namespace declaration
    for this prefix in the expression context, and the corresponding namespace URI is the one that
    is associated with this prefix. It is an error if the QName has a prefix for which there is no
    namespace declaration in the expression context. 
     <p>If the QName has no prefix and the principal node type of the axis is element, then the default
    element namespace is used. Otherwise if the QName has no prefix, the namespace URI is null. The
    default element namespace is a member of the context for the XPath expression. The value of the
    default element namespace when executing an XPath expression through the DOM3 XPath API is
    determined in the following way:</p>
     <ol>
      <li data-md="">
       <p>If the context node is from an HTML DOM, the default element namespace is
"https://www.w3.org/1999/xhtml".</p>
      </li><li data-md="">
       <p>Otherwise, the default element namespace URI is null.</p>
     </li></ol>
     <p class="note" role="note"> This is equivalent to adding the default element namespace feature of XPath 2.0 to XPath 1.0,
      and using the HTML namespace as the default element namespace for HTML documents. It is
      motivated by the desire to have implementations be compatible with legacy HTML content while
      still supporting the changes that this specification introduces to HTML regarding the
      namespace used for HTML elements, and by the desire to use XPath 1.0 rather than XPath 2.0. </p>
    </blockquote>
    <p class="note" role="note"> This change is a <a data-link-type="dfn" href="introduction.html#willful-violation" id="ref-for-willful-violation-2">willful violation</a> of the XPath 1.0 specification, motivated by
    desire to have implementations be compatible with legacy content while still supporting the
    changes that this specification introduces to HTML regarding which namespace is used for HTML
    elements. <a data-link-type="biblio" href="references.html#biblio-xpath">[XPATH]</a> </p>
    <hr>
    <p>XSLT 1.0 processors outputting to a DOM when the output method is "html" (either explicitly or via
  the defaulting rule in XSLT 1.0) are affected as follows:</p>
    <p>If the transformation program outputs an element in no namespace, the processor must, prior to
  constructing the corresponding DOM element node, change the namespace of the element to the <a data-link-type="dfn" href="infrastructure.html#html-namespace" id="ref-for-html-namespace-6">HTML namespace</a>, <a data-link-type="dfn" href="infrastructure.html#converting-a-string-to-ascii-lowercase" id="ref-for-converting-a-string-to-ascii-lowercase-1">ASCII-lowercase</a> the element’s local name, and <a data-link-type="dfn" href="infrastructure.html#converting-a-string-to-ascii-lowercase" id="ref-for-converting-a-string-to-ascii-lowercase-2">ASCII-lowercase</a> the names of any non-namespaced attributes on the element.</p>
    <p class="note" role="note"> This requirement is a <a data-link-type="dfn" href="introduction.html#willful-violation" id="ref-for-willful-violation-3">willful violation</a> of the XSLT 1.0 specification, required because
    this specification changes the namespaces and case-sensitivity rules of HTML in a manner that
    would otherwise be incompatible with DOM-based XSLT transformations. (Processors that serialize
    the output are unaffected.) <a data-link-type="biblio" href="references.html#biblio-xslt">[XSLT]</a> </p>
    <hr>
    <p>This specification does not specify precisely how XSLT processing interacts with the <a data-link-type="dfn" href="syntax.html#html-parser" id="ref-for-html-parser-1">HTML parser</a> infrastructure (for example, whether an XSLT processor acts as if it puts any
  elements into a <a data-link-type="dfn" href="syntax.html#stack-of-open-elements" id="ref-for-stack-of-open-elements-1">stack of open elements</a>). However, XSLT processors must <a data-link-type="dfn" href="syntax.html#stopped" id="ref-for-stopped-1">stop parsing</a> if they successfully complete, and must set the <a data-link-type="dfn" href="dom.html#current-document-readiness" id="ref-for-current-document-readiness-1">current document readiness</a> first to
  "<code>interactive</code>" and then to "<code>complete</code>" if they are aborted.</p>
    <hr>
    <p>This specification does not specify how XSLT interacts with the <a data-link-type="dfn" href="browsers.html#navigated" id="ref-for-navigated-1">navigation</a> algorithm, how
  it fits in with the <a data-link-type="dfn" href="webappapis.html#event-loop" id="ref-for-event-loop-2">event loop</a>, nor how error pages are to be handled (e.g., whether XSLT
  errors are to replace an incremental XSLT output, or are rendered inline, etc).</p>
    <p class="note" role="note"> There are also additional non-normative comments regarding the interaction of XSLT and HTML <a href="semantics-scripting.html#interaction-of-script-elements-and-xslt">in the <code>script</code> element section</a>,
    and of XSLT, XPath, and HTML <a href="semantics-scripting.html#interaction-of-template-elements-with-xslt-and-xpath">in the <code>template</code> element section</a>. </p>
    <h3 class="heading settled" data-level="2.3" id="case-sensitivity-and-string-comparison"><span class="secno">2.3. </span><span class="content">Case-sensitivity and string comparison</span><a class="self-link" href="infrastructure.html#case-sensitivity-and-string-comparison"></a></h3>
    <p>Comparing two strings in a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="case-sensitive">case-sensitive</dfn> manner means comparing them exactly, code
  point for code point.</p>
    <p>Comparing two strings in an <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="ascii-case-insensitive">ASCII case-insensitive</dfn> manner means comparing them exactly,
  code point for code point, except that the characters in the range U+0041 to U+005A (i.e., LATIN
  CAPITAL LETTER A to LATIN CAPITAL LETTER Z) and the corresponding characters in the range U+0061
  to U+007A (i.e., LATIN SMALL LETTER A to LATIN SMALL LETTER Z) are considered to also match.</p>
    <p>Comparing two strings in a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="compatibility-caseless">compatibility caseless</dfn> manner means using the Unicode <i>compatibility caseless match</i> operation to compare the two strings, with no
  language-specific tailorings. <a data-link-type="biblio" href="references.html#biblio-unicode">[UNICODE]</a></p>
    <p>Except where otherwise stated, string comparisons must be performed in a <a data-link-type="dfn" href="infrastructure.html#case-sensitive" id="ref-for-case-sensitive-1">case-sensitive</a> manner.</p>
    <p><dfn data-dfn-type="dfn" data-noexport="" id="converting-a-string-to-ascii-uppercase">Converting a string to ASCII uppercase<a class="self-link" href="infrastructure.html#converting-a-string-to-ascii-uppercase"></a></dfn> means replacing all characters in the range
  U+0061 to U+007A (i.e., LATIN SMALL LETTER A to LATIN SMALL LETTER Z) with the corresponding
  characters in the range U+0041 to U+005A (i.e., LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z).</p>
    <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="converting-a-string-to-ascii-lowercase">Converting a string to ASCII lowercase</dfn> means replacing all characters in the range
  U+0041 to U+005A (i.e., LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z) with the corresponding
  characters in the range U+0061 to U+007A (i.e., LATIN SMALL LETTER A to LATIN SMALL LETTER Z).</p>
    <p>A string <var>pattern</var> is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="prefix-match">prefix match</dfn> for a string <var>s</var> when <var>pattern</var> is not longer than <var>s</var> and truncating <var>s</var> to <var>pattern</var>’s length leaves the two strings as matches of each other.</p>
    <h3 class="heading settled" data-level="2.4" id="common-microsyntaxes"><span class="secno">2.4. </span><span class="content">Common microsyntaxes</span><a class="self-link" href="infrastructure.html#common-microsyntaxes"></a></h3>
    <p>There are various places in HTML that accept particular data types, such as dates or numbers. This
  section describes what the conformance criteria for content in those formats is, and how to parse
  them.</p>
    <p class="note" role="note"> Implementors are strongly urged to carefully examine any third-party libraries they might
    consider using to implement the parsing of syntaxes described below. For example, date
    libraries are likely to implement error handling behavior that differs from what is required
    in this specification, since error-handling behavior is often not defined in specifications
    that describe date syntaxes similar to those used in this specification, and thus
    implementations tend to vary greatly in how they handle errors. </p>
    <h4 class="heading settled" data-level="2.4.1" id="common-parser-idioms"><span class="secno">2.4.1. </span><span class="content">Common parser idioms</span><a class="self-link" href="infrastructure.html#common-parser-idioms"></a></h4>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="space-characters">space characters</dfn>, for the purposes of this specification, are U+0020 SPACE, U+0009
  CHARACTER TABULATION (tab), U+000A LINE FEED (LF), U+000C FORM FEED (FF), and U+000D CARRIAGE
  RETURN (CR).</p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="white_space|white_space characters" data-noexport="" id="white_space">White_Space characters</dfn> are those that have the Unicode property "White_Space" in
  the Unicode <code>PropList.txt</code> data file. <a data-link-type="biblio" href="references.html#biblio-unicode">[UNICODE]</a></p>
    <p class="note" role="note"> This should not be confused with the "White_Space" value (abbreviated "WS") of the "Bidi_Class"
    property in the <code>Unicode.txt</code> data file. </p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="control-characters">control characters</dfn> are those whose Unicode "General_Category" property has the
  value "Cc" in the Unicode <code>UnicodeData.txt</code> data file. <a data-link-type="biblio" href="references.html#biblio-unicode">[UNICODE]</a></p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="uppercase-ascii-letters">uppercase ASCII letters</dfn> are the characters in the range U+0041 LATIN CAPITAL LETTER
  A to U+005A LATIN CAPITAL LETTER Z.</p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="lowercase-ascii-letters">lowercase ASCII letters</dfn> are the characters in the range U+0061 LATIN SMALL LETTER A
  to U+007A LATIN SMALL LETTER Z.</p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="ascii-digits">ASCII digits</dfn> are the characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT
  NINE (9).</p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="alphanumeric-ascii-characters">alphanumeric ASCII characters</dfn> are those that are either <a data-link-type="dfn" href="infrastructure.html#uppercase-ascii-letters" id="ref-for-uppercase-ascii-letters-1">uppercase ASCII letters</a>, <a data-link-type="dfn" href="infrastructure.html#lowercase-ascii-letters" id="ref-for-lowercase-ascii-letters-1">lowercase ASCII letters</a>, or <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-1">ASCII digits</a>.</p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="ascii-hex-digits">ASCII hex digits</dfn> are the characters in the ranges U+0030 DIGIT ZERO (0) to U+0039
  DIGIT NINE (9), U+0041 LATIN CAPITAL LETTER A to U+0046 LATIN CAPITAL LETTER F, and U+0061 LATIN
  SMALL LETTER A to U+0066 LATIN SMALL LETTER F.</p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="uppercase-ascii-hex-digits">uppercase ASCII hex digits</dfn> are the characters in the ranges U+0030 DIGIT ZERO (0)
  to U+0039 DIGIT NINE (9) and U+0041 LATIN CAPITAL LETTER A to U+0046 LATIN CAPITAL LETTER F only.</p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="lowercase-ascii-hex-digits">lowercase ASCII hex digits</dfn> are the characters in the ranges U+0030 DIGIT ZERO (0)
  to U+0039 DIGIT NINE (9) and U+0061 LATIN SMALL LETTER A to U+0066 LATIN SMALL LETTER F only.</p>
    <p>Some of the micro-parsers described below follow the pattern of having an <var>input</var> variable that holds the string being parsed, and having a <var>position</var> variable pointing at
  the next character to parse in <var>input</var>.</p>
    <p>For parsers based on this pattern, a step that requires the user agent to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="collect a sequence of characters" data-noexport="" id="collect-a-sequence-of-characters">collect a sequence
  of characters</dfn> means that the following algorithm must be run, with <var>characters</var> being the set of characters that can be collected:</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> and <var>position</var> be the same variables as those of the same name in
  the algorithm that invoked these steps.</p>
     </li><li data-md="">
      <p>Let <var>result</var> be the empty string.</p>
     </li><li data-md="">
      <p>While <var>position</var> doesn’t point past the end of <var>input</var> and the character at <var>position</var> is one of the <var>characters</var>, append that character to the end of <var>result</var> and advance <var>position</var> to the next character in <var>input</var>.</p>
     </li><li data-md="">
      <p>Return <var>result</var>.</p>
    </li></ol>
    <p>The step <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="skip-whitespace">skip whitespace</dfn> means that the user agent must <a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-1">collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-2">space characters</a>. The collected characters
  are not used.</p>
    <p>When a user agent is to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="stripped line breaks|strip line breaks" data-noexport="" id="stripped-line-breaks">strip line breaks</dfn> from a string, the user agent must remove
  any U+000A LINE FEED (LF) and U+000D CARRIAGE RETURN (CR) characters from that string.</p>
    <p>When a user agent is to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="strip leading and trailing whitespace|stripping leading and trailing whitespace|leading and trailing whitespace stripped" data-noexport="" id="strip-leading-and-trailing-whitespace">strip leading and trailing whitespace</dfn> from a string, the
  user agent must remove all <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-3">space characters</a> that are at the start or end of the string.</p>
    <p>When a user agent is to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="stripping and collapsing whitespace|strip and collapse whitespace" data-noexport="" id="stripping-and-collapsing-whitespace">strip and collapse whitespace</dfn> in a string, it must replace any
  sequence of one or more consecutive <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-4">space characters</a> in that string with a single U+0020
  SPACE character, and then <a data-link-type="dfn" href="infrastructure.html#strip-leading-and-trailing-whitespace" id="ref-for-strip-leading-and-trailing-whitespace-1">strip leading and trailing whitespace</a> from that string.</p>
    <p>When a user agent has to <dfn data-dfn-type="dfn" data-lt="strictly splitting the string|strictly split a string|strictly split" data-noexport="" id="strictly-splitting-the-string">strictly split a string<a class="self-link" href="infrastructure.html#strictly-splitting-the-string"></a></dfn> on a particular delimiter character <var>delimiter</var>, it must use the following algorithm:</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially
  pointing at the start of the string.</p>
     </li><li data-md="">
      <p>Let <var>tokens</var> be an ordered list of tokens, initially empty.</p>
     </li><li data-md="">
      <p>While <var>position</var> is not past the end of <var>input</var>:</p>
      <ol>
       <li data-md="">
        <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-2">Collect a sequence of characters</a> that are not the <var>delimiter</var> character.</p>
       </li><li data-md="">
        <p>Append the string collected in the previous step to <var>tokens</var>.</p>
       </li><li data-md="">
        <p>Advance <var>position</var> to the next character in <var>input</var>.</p>
      </li></ol>
     </li><li data-md="">
      <p>Return <var>tokens</var>.</p>
    </li></ol>
    <p class="note" role="note"> For the special cases of splitting a string <a data-link-type="dfn" href="infrastructure.html#split-a-string-on-spaces" id="ref-for-split-a-string-on-spaces-1">on spaces</a> and <a data-link-type="dfn" href="infrastructure.html#split-a-string-on-commas" id="ref-for-split-a-string-on-commas-1">on commas</a>, this
    algorithm does not apply (those algorithms also perform <a data-link-type="dfn" href="infrastructure.html#strip-leading-and-trailing-whitespace" id="ref-for-strip-leading-and-trailing-whitespace-2">whitespace trimming</a>). </p>
    <h4 class="heading settled" data-level="2.4.2" id="sec-boolean-attributes"><span class="secno">2.4.2. </span><span class="content">Boolean attributes</span><a class="self-link" href="infrastructure.html#sec-boolean-attributes"></a></h4>
    <p>A number of attributes are <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="boolean attribute|boolean attributes" data-noexport="" id="boolean-attribute">boolean attributes</dfn>. The presence of a boolean attribute on
  an element represents the true value, and the absence of the attribute represents the false value.</p>
    <p>If the attribute is present, its value must either be the empty string or a value that is an <a data-link-type="dfn" href="infrastructure.html#ascii-case-insensitive" id="ref-for-ascii-case-insensitive-1">ASCII case-insensitive</a> match for the attribute’s canonical name, with no leading or
  trailing whitespace.</p>
    <p class="note" role="note"> The values "true" and "false" are not allowed on <a data-link-type="dfn" href="infrastructure.html#boolean-attribute" id="ref-for-boolean-attribute-1">boolean attributes</a>. To represent a false value,
    the attribute has to be omitted altogether. </p>
    <div class="example" id="example-2267e227">
     <a class="self-link" href="infrastructure.html#example-2267e227"></a> Here is an example of a checkbox that is checked and disabled. The <code>checked</code> and <code>disabled</code> attributes are the <a data-link-type="dfn" href="infrastructure.html#boolean-attribute" id="ref-for-boolean-attribute-2">boolean attributes</a>. 
<pre class="highlight"><span class="nt">&lt;label&gt;&lt;input</span> <span class="na">type=</span><span class="s">checkbox</span> <span class="na">checked</span> <span class="na">name=</span><span class="s">cheese</span> <span class="na">disabled</span><span class="nt">&gt;</span> Cheese<span class="nt">&lt;/label&gt;</span>
</pre>
     <p>This could be equivalently written as this:</p>
<pre class="highlight"><span class="nt">&lt;label&gt;&lt;input</span> <span class="na">type=</span><span class="s">checkbox</span> <span class="na">checked=</span><span class="s">checked</span> <span class="na">name=</span><span class="s">cheese</span> <span class="na">disabled=</span><span class="s">disabled</span><span class="nt">&gt;</span> Cheese<span class="nt">&lt;/label&gt;</span>
</pre>
     <p>You can also mix styles; the following is still equivalent:</p>
<pre class="highlight"><span class="nt">&lt;label&gt;&lt;input</span> <span class="na">type=</span><span class="s">'checkbox'</span> <span class="na">checked</span> <span class="na">name=</span><span class="s">cheese</span> <span class="na">disabled=</span><span class="s">""</span><span class="nt">&gt;</span> Cheese<span class="nt">&lt;/label&gt;</span>
</pre>
    </div>
    <h4 class="heading settled" data-level="2.4.3" id="keywords-and-enumerated-attributes"><span class="secno">2.4.3. </span><span class="content">Keywords and enumerated attributes</span><a class="self-link" href="infrastructure.html#keywords-and-enumerated-attributes"></a></h4>
    <p>Some attributes are defined as taking one of a finite set of keywords. Such attributes are called <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="enumerated-attributes">enumerated attributes</dfn>. The keywords are each defined to map to a particular <em>state</em> (several keywords might map to the same state, in which case some of the keywords
  are synonyms of each other; additionally, some of the keywords can be said to be non-conforming,
  and are only in the specification for historical reasons). In addition, two default states can be
  given. The first is the <dfn data-dfn-type="dfn" data-noexport="" id="invalid-value-default"><i>invalid value default</i><a class="self-link" href="infrastructure.html#invalid-value-default"></a></dfn>, the second is the <dfn data-dfn-type="dfn" data-noexport="" id="missing-value-default"><i>missing value default</i><a class="self-link" href="infrastructure.html#missing-value-default"></a></dfn>.</p>
    <p>If an enumerated attribute is specified, the attribute’s value must be an <a data-link-type="dfn" href="infrastructure.html#ascii-case-insensitive" id="ref-for-ascii-case-insensitive-2">ASCII case-insensitive</a> match for one of the given keywords that are not said to be
  non-conforming, with no leading or trailing whitespace.</p>
    <p>When the attribute is specified, if its value is an <a data-link-type="dfn" href="infrastructure.html#ascii-case-insensitive" id="ref-for-ascii-case-insensitive-3">ASCII case-insensitive</a> match for one of
  the given keywords then that keyword’s state is the state that the attribute represents. If the
  attribute value matches none of the given keywords, but the attribute has an <i>invalid value default</i>, then the attribute represents that state. Otherwise, if the
  attribute value matches none of the keywords but there is a <i>missing value default</i> state
  defined, then <em>that</em> is the state represented by the attribute. Otherwise, there is no
  default, and invalid values mean that there is no state represented.</p>
    <p>When the attribute is <em>not</em> specified, if there is a <i>missing value default</i> state
  defined, then that is the state represented by the (missing) attribute. Otherwise, the absence of
  the attribute means that there is no state represented.</p>
    <p class="note" role="note">The empty string can be a valid keyword.</p>
    <h4 class="heading settled" data-level="2.4.4" id="numbers"><span class="secno">2.4.4. </span><span class="content">Numbers</span><a class="self-link" href="infrastructure.html#numbers"></a></h4>
    <h5 class="heading settled" data-level="2.4.4.1" id="signed-integers"><span class="secno">2.4.4.1. </span><span class="content">Signed integers</span><a class="self-link" href="infrastructure.html#signed-integers"></a></h5>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="valid integer|valid integers" data-noexport="" id="valid-integer">valid integer</dfn> if it consists of one or more <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-2">ASCII digits</a>,
  optionally prefixed with a U+002D HYPHEN-MINUS character (-).</p>
    <p>A <a data-link-type="dfn" href="infrastructure.html#valid-integer" id="ref-for-valid-integer-3">valid integer</a> without a U+002D HYPHEN-MINUS (-) prefix represents the number that is
  represented in base ten by that string of digits. A <a data-link-type="dfn" href="infrastructure.html#valid-integer" id="ref-for-valid-integer-4">valid integer</a> <em>with</em> a U+002D
  HYPHEN-MINUS (-) prefix represents the number represented in base ten by the string of digits that
  follows the U+002D HYPHEN-MINUS, subtracted from zero.</p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="parse token as an integer|parse it as an integer|rules for parsing integers|rules for parsing integer|rules for parsing signed integers" data-noexport="" id="parse-token-as-an-integer">rules for parsing integers</dfn> are as given in the following algorithm. When
  invoked, the steps must be followed in the order given, aborting at the first step that returns
  a value. This algorithm will return either an integer or an error.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the
  start of the string.</p>
     </li><li data-md="">
      <p>Let <var>sign</var> have the value "positive".</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#skip-whitespace" id="ref-for-skip-whitespace-1">Skip whitespace</a>.</p>
     </li><li data-md="">
      <p>If <var>position</var> is past the end of <var>input</var>, return an error.</p>
     </li><li data-md="">
      <p>If the character indicated by <var>position</var> (the first character) is a U+002D
  HYPHEN-MINUS character (-):</p>
      <ol>
       <li data-md="">
        <p>Let <var>sign</var> be "negative".</p>
       </li><li data-md="">
        <p>Advance <var>position</var> to the next character.</p>
       </li><li data-md="">
        <p>If <var>position</var> is past the end of <var>input</var>, return an error.</p>
      </li></ol>
      <p>Otherwise, if the character indicated by <var>position</var> (the first character) is a
  U+002B PLUS SIGN character (+):</p>
      <ol>
       <li data-md="">
        <p>Advance <var>position</var> to the next character. (The "<code>+</code>" is ignored, but
  it is not conforming.)</p>
       </li><li data-md="">
        <p>If <var>position</var> is past the end of <var>input</var>, return an error.</p>
      </li></ol>
     </li><li data-md="">
      <p>If the character indicated by <var>position</var> is not an <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-3">ASCII digit</a>, then return
  an error.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-3">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-4">ASCII digits</a>, and interpret the
  resulting sequence as a base-ten integer. Let <var>value</var> be that integer.</p>
     </li><li data-md="">
      <p>If <var>sign</var> is "positive", return <var>value</var>, otherwise return the result of
  subtracting <var>value</var> from zero.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.4.4.2" id="non-negative-integers"><span class="secno">2.4.4.2. </span><span class="content">Non-negative integers</span><a class="self-link" href="infrastructure.html#non-negative-integers"></a></h5>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-non-negative-integer">valid non-negative integer</dfn> if it consists of one or more <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-5">ASCII digits</a>.</p>
    <p>A <a data-link-type="dfn" href="infrastructure.html#valid-non-negative-integer" id="ref-for-valid-non-negative-integer-1">valid non-negative integer</a> represents the number that is represented in base ten by that
  string of digits.</p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="parse that attribute’s value|rules for parsing non-negative integers" data-noexport="" id="parse-that-attributes-value">rules for parsing non-negative integers</dfn> are as given in the following algorithm.
  When invoked, the steps must be followed in the order given, aborting at the first step that
  returns a value. This algorithm will return either zero, a positive integer, or an error.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>value</var> be the result of parsing <var>input</var> using the <a data-link-type="dfn" href="infrastructure.html#parse-token-as-an-integer" id="ref-for-parse-token-as-an-integer-2">rules for parsing integers</a>.</p>
     </li><li data-md="">
      <p>If <var>value</var> is an error, return an error.</p>
     </li><li data-md="">
      <p>If <var>value</var> is less than zero, return an error.</p>
     </li><li data-md="">
      <p>Return <var>value</var>.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.4.4.3" id="floating-point-numbers"><span class="secno">2.4.4.3. </span><span class="content">Floating-point numbers</span><a class="self-link" href="infrastructure.html#floating-point-numbers"></a></h5>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-floating-point-number">valid floating-point number</dfn> if it consists of:</p>
    <ol>
     <li data-md="">
      <p>Optionally, a U+002D HYPHEN-MINUS character (-).</p>
     </li><li data-md="">
      <p>One or both of the following, in the given order:</p>
      <ol>
       <li data-md="">
        <p>A series of one or more <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-6">ASCII digits</a>.</p>
       </li><li data-md="">
        <p>Both of the following, in the given order:</p>
        <ol>
         <li data-md="">
          <p>A single U+002E FULL STOP character (.).</p>
         </li><li data-md="">
          <p>A series of one or more <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-7">ASCII digits</a>.</p>
        </li></ol>
      </li></ol>
     </li><li data-md="">
      <p>Optionally:</p>
      <ol>
       <li data-md="">
        <p>Either a U+0065 LATIN SMALL LETTER E character (e) or a U+0045 LATIN CAPITAL LETTER E
  character (E).</p>
       </li><li data-md="">
        <p>Optionally, a U+002D HYPHEN-MINUS character (-) or U+002B PLUS SIGN character (+).</p>
       </li><li data-md="">
        <p>A series of one or more <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-8">ASCII digits</a>.</p>
      </li></ol>
    </li></ol>
    <p>A <a data-link-type="dfn" href="infrastructure.html#valid-floating-point-number" id="ref-for-valid-floating-point-number-1">valid floating-point number</a> represents the number obtained by multiplying the significand
  by ten raised to the power of the exponent, where the significand is the first number, interpreted
  as base ten (including the decimal point and the number after the decimal point, if any, and
  interpreting the significand as a negative number if the whole string starts with a U+002D
  HYPHEN-MINUS character (-) and the number is not zero), and where the exponent is the number after
  the E, if any (interpreted as a negative number if there is a U+002D HYPHEN-MINUS character (-)
  between the E and the number and the number is not zero, or else ignoring a U+002B PLUS SIGN
  character (+) between the E and the number if there is one). If there is no E, then the exponent
  is treated as zero.</p>
    <p class="note" role="note">The Infinity and Not-a-Number (NaN) values are not <a data-link-type="dfn" href="infrastructure.html#valid-floating-point-number" id="ref-for-valid-floating-point-number-2">valid floating-point numbers</a>.</p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="best floating-point number" data-noexport="" id="best-floating-point-number">best representation of the number <var>n</var> as a floating-point number</dfn> is the
  string obtained from running ToString(<var>n</var>). The abstract operation ToString is not
  uniquely determined. When there are multiple possible strings that could be obtained from ToString
  for a particular value, the user agent must always return the same string for that value (though
  it may differ from the value used by other user agents).</p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="rules-for-parsing-floating-point-number-values">rules for parsing floating-point number values</dfn> are as given in the following
  algorithm. This algorithm must be aborted at the first step that returns something. This
  algorithm will return either a number or an error.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start
  of the string.</p>
     </li><li data-md="">
      <p>Let <var>value</var> have the value 1.</p>
     </li><li data-md="">
      <p>Let <var>divisor</var> have the value 1.</p>
     </li><li data-md="">
      <p>Let <var>exponent</var> have the value 1.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#skip-whitespace" id="ref-for-skip-whitespace-2">Skip whitespace</a>.</p>
     </li><li data-md="">
      <p>If <var>position</var> is past the end of <var>input</var>, return an error.</p>
     </li><li data-md="">
      <p>If the character indicated by <var>position</var> is a U+002D HYPHEN-MINUS character (-):</p>
      <ol>
       <li data-md="">
        <p>Change <var>value</var> and <var>divisor</var> to -1.</p>
       </li><li data-md="">
        <p>Advance <var>position</var> to the next character.</p>
       </li><li data-md="">
        <p>If <var>position</var> is past the end of <var>input</var>, return an error.</p>
      </li></ol>
      <p>Otherwise, if the character indicated by <var>position</var> (the first character) is a
  U+002B PLUS SIGN character (+):</p>
      <ol>
       <li data-md="">
        <p>Advance <var>position</var> to the next character. (The "<code>+</code>" is ignored, but
  it is not conforming.)</p>
       </li><li data-md="">
        <p>If <var>position</var> is past the end of <var>input</var>, return an error.</p>
      </li></ol>
     </li><li data-md="">
      <p>If the character indicated by <var>position</var> is a U+002E FULL STOP (.), and that is not
  the last character in <var>input</var>, and the character after the character indicated by <var>position</var> is an <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-9">ASCII digit</a>, then set <var>value</var> to zero and jump to the step labeled <i>fraction</i>.</p>
     </li><li data-md="">
      <p>If the character indicated by <var>position</var> is not an <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-10">ASCII digit</a>, then return
  an error.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-4">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-11">ASCII digits</a>, and interpret the
  resulting sequence as a base-ten integer. Multiply <var>value</var> by that integer.</p>
     </li><li data-md="">
      <p>If <var>position</var> is past the end of <var>input</var>, jump to the step labeled <i>conversion</i>.</p>
     </li><li data-md="">
      <p><i>Fraction</i>: If the character indicated by <var>position</var> is a U+002E FULL STOP
  (.), run these substeps:</p>
      <ol>
       <li data-md="">
        <p>Advance <var>position</var> to the next character.</p>
       </li><li data-md="">
        <p>If <var>position</var> is past the end of <var>input</var>, or if the character indicated
  by <var>position</var> is not an <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-12">ASCII digit</a>, U+0065 LATIN SMALL LETTER E (e), or
  U+0045 LATIN CAPITAL LETTER E (E), then jump to the step labeled <i>conversion</i>.</p>
       </li><li data-md="">
        <p>If the character indicated by <var>position</var> is a U+0065 LATIN SMALL LETTER E
  character (e) or a U+0045 LATIN CAPITAL LETTER E character (E), skip the remainder of
  these substeps.</p>
       </li><li data-md="">
        <p><i>Fraction loop</i>: Multiply <var>divisor</var> by ten.</p>
       </li><li data-md="">
        <p>Add the value of the character indicated by <var>position</var>, interpreted as a
  base-ten digit (0..9) and divided by <var>divisor</var>, to <var>value</var>.</p>
       </li><li data-md="">
        <p>Advance <var>position</var> to the next character.</p>
       </li><li data-md="">
        <p>If <var>position</var> is past the end of <var>input</var>, then jump to the step labeled <i>conversion</i>.</p>
       </li><li data-md="">
        <p>If the character indicated by <var>position</var> is an <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-13">ASCII digit</a>, jump back to
  the step labeled <i>fraction loop</i> in these substeps.</p>
      </li></ol>
     </li><li data-md="">
      <p>If the character indicated by <var>position</var> is a U+0065 LATIN SMALL LETTER E character
  (e) or a U+0045 LATIN CAPITAL LETTER E character (E), run these substeps:</p>
      <ol>
       <li data-md="">
        <p>Advance <var>position</var> to the next character.</p>
       </li><li data-md="">
        <p>If <var>position</var> is past the end of <var>input</var>, then jump to the step labeled <i>conversion</i>.</p>
       </li><li data-md="">
        <p>If the character indicated by <var>position</var> is a U+002D HYPHEN-MINUS character (-):</p>
        <ol>
         <li data-md="">
          <p>Change <var>exponent</var> to -1.</p>
         </li><li data-md="">
          <p>Advance <var>position</var> to the next character.</p>
         </li><li data-md="">
          <p>If <var>position</var> is past the end of <var>input</var>, then jump to the step
  labeled <i>conversion</i>.</p>
        </li></ol>
        <p>Otherwise, if the character indicated by <var>position</var> is a U+002B PLUS SIGN character
  (+):</p>
        <ol>
         <li data-md="">
          <p>Advance <var>position</var> to the next character.</p>
         </li><li data-md="">
          <p>If <var>position</var> is past the end of <var>input</var>, then jump to the step
  labeled <i>conversion</i>.</p>
        </li></ol>
       </li><li data-md="">
        <p>If the character indicated by <var>position</var> is not an <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-14">ASCII digit</a>, then jump
  to the step labeled <i>conversion</i>.</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-5">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-15">ASCII digits</a>, and interpret the
  resulting sequence as a base-ten integer. Multiply <var>exponent</var> by that integer.</p>
       </li><li data-md="">
        <p>Multiply <var>value</var> by ten raised to the <var>exponent</var>th power.</p>
      </li></ol>
     </li><li data-md="">
      <p><i>Conversion</i>: Let <var>S</var> be the set of finite IEEE 754 double-precision
  floating-point values except -0, but with two special values added: 2<sup>1024</sup> and -2<sup>1024</sup>.</p>
     </li><li data-md="">
      <p>Let <var>rounded-value</var> be the number in <var>S</var> that is closest to <var>value</var>, selecting the number with an even significand if there are two equally
  close values. (The two special values 2<sup>1024</sup> and -2<sup>1024</sup> are
  considered to have even significands for this purpose.)</p>
     </li><li data-md="">
      <p>If <var>rounded-value</var> is 2<sup>1024</sup> or -2<sup>1024</sup>, return an error.</p>
     </li><li data-md="">
      <p>Return <var>rounded-value</var>.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.4.4.4" id="percentages-and-dimensions"><span class="secno">2.4.4.4. </span><span class="content">Percentages and lengths</span><a class="self-link" href="infrastructure.html#percentages-and-dimensions"></a></h5>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="rules-for-parsing-dimension-values">rules for parsing dimension values</dfn> are as given in the following algorithm. When
  invoked, the steps must be followed in the order given, aborting at the first step that returns
  a value. This algorithm will return either a number greater than or equal to 0.0, or an error;
  if a number is returned, then it is further categorized as either a percentage or a length.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start
  of the string.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#skip-whitespace" id="ref-for-skip-whitespace-3">Skip whitespace</a>.</p>
     </li><li data-md="">
      <p>If <var>position</var> is past the end of <var>input</var>, return an error.</p>
     </li><li data-md="">
      <p>If the character indicated by <var>position</var> is a U+002B PLUS SIGN character (+),
  advance <var>position</var> to the next character.</p>
     </li><li data-md="">
      <p>If <var>position</var> is past the end of <var>input</var>, return an error.</p>
     </li><li data-md="">
      <p>If the character indicated by <var>position</var> is not an <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-16">ASCII digit</a>, then return
  an error.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-6">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-17">ASCII digits</a>, and interpret the
  resulting sequence as a base-ten integer. Let <var>value</var> be that number.</p>
     </li><li data-md="">
      <p>If <var>position</var> is past the end of <var>input</var>, return <var>value</var> as a
  length.</p>
     </li><li data-md="">
      <p>If the character indicated by <var>position</var> is a U+002E FULL STOP character (.):</p>
      <ol>
       <li data-md="">
        <p>Advance <var>position</var> to the next character.</p>
       </li><li data-md="">
        <p>If <var>position</var> is past the end of <var>input</var>, or if the character indicated
  by <var>position</var> is not an <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-18">ASCII digit</a>, then return <var>value</var> as a
  length.</p>
       </li><li data-md="">
        <p>Let <var>divisor</var> have the value 1.</p>
       </li><li data-md="">
        <p><i>Fraction loop</i>: Multiply <var>divisor</var> by ten.</p>
       </li><li data-md="">
        <p>Add the value of the character indicated by <var>position</var>, interpreted as a
  base-ten digit (0..9) and divided by <var>divisor</var>, to <var>value</var>.</p>
       </li><li data-md="">
        <p>Advance <var>position</var> to the next character.</p>
       </li><li data-md="">
        <p>If <var>position</var> is past the end of <var>input</var>, then return <var>value</var> as a length.</p>
       </li><li data-md="">
        <p>If the character indicated by <var>position</var> is an <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-19">ASCII digit</a>, return to the
  step labeled <i>fraction loop</i> in these substeps.</p>
      </li></ol>
     </li><li data-md="">
      <p>If <var>position</var> is past the end of <var>input</var>, return <var>value</var> as a
  length.</p>
     </li><li data-md="">
      <p>If the character indicated by <var>position</var> is a U+0025 PERCENT SIGN character (%),
  return <var>value</var> as a percentage.</p>
     </li><li data-md="">
      <p>Return <var>value</var> as a length.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.4.4.5" id="non-zero-percentages-and-lengths"><span class="secno">2.4.4.5. </span><span class="content">Non-zero percentages and lengths</span><a class="self-link" href="infrastructure.html#non-zero-percentages-and-lengths"></a></h5>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="rules-for-parsing-non-zero-dimension-values">rules for parsing non-zero dimension values</dfn> are as given in the following
  algorithm. When invoked, the steps must be followed in the order given, aborting at the first
  step that returns a value. This algorithm will return either a number greater than 0.0, or an
  error; if a number is returned, then it is further categorized as either a percentage or a
  length.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>value</var> be the result of parsing <var>input</var> using the <a data-link-type="dfn" href="infrastructure.html#rules-for-parsing-dimension-values" id="ref-for-rules-for-parsing-dimension-values-1">rules for parsing dimension values</a>.</p>
     </li><li data-md="">
      <p>If <var>value</var> is an error, return an error.</p>
     </li><li data-md="">
      <p>If <var>value</var> is zero, return an error.</p>
     </li><li data-md="">
      <p>If <var>value</var> is a percentage, return <var>value</var> as a percentage.</p>
     </li><li data-md="">
      <p>Return <var>value</var> as a length.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.4.4.6" id="lists-of-floating-point-numbers"><span class="secno">2.4.4.6. </span><span class="content">Lists of floating-point numbers</span><a class="self-link" href="infrastructure.html#lists-of-floating-point-numbers"></a></h5>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-list-of-floating-point-numbers">valid list of floating-point numbers</dfn> is a number of <a data-link-type="dfn" href="infrastructure.html#valid-floating-point-number" id="ref-for-valid-floating-point-number-3">valid floating-point numbers</a> separated by U+002C COMMA characters, with no other characters
  (e.g. no <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-5">space characters</a>). In addition, there might be restrictions on the number of
  floating-point numbers that can be given, or on the range of values allowed.</p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="rules-for-parsing-a-list-of-floating-point-numbers">rules for parsing a list of floating-point numbers</dfn> are as follows:</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start of
  the string.</p>
     </li><li data-md="">
      <p>Let <var>numbers</var> be an initially empty list of floating-point numbers. This list will be
  the result of this algorithm.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-7">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-6">space characters</a>, U+002C COMMA, or
  U+003B SEMICOLON characters. This skips past any leading delimiters.</p>
     </li><li data-md="">
      <p>While <var>position</var> is not past the end of <var>input</var>:</p>
      <ol>
       <li data-md="">
        <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-8">Collect a sequence of characters</a> that are not <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-7">space characters</a>, U+002C COMMA,
  U+003B SEMICOLON, <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-20">ASCII digits</a>, U+002E FULL STOP, or U+002D HYPHEN-MINUS
  characters. This skips past leading garbage.</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-9">Collect a sequence of characters</a> that are not <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-8">space characters</a>, U+002C COMMA,
  or U+003B SEMICOLON characters, and let <var>unparsed number</var> be the result.</p>
       </li><li data-md="">
        <p>Let <var>number</var> be the result of parsing <var>unparsed number</var> using the <a data-link-type="dfn" href="infrastructure.html#rules-for-parsing-floating-point-number-values" id="ref-for-rules-for-parsing-floating-point-number-values-1">rules for parsing floating-point number values</a>.</p>
       </li><li data-md="">
        <p>If <var>number</var> is an error, set <var>number</var> to zero.</p>
       </li><li data-md="">
        <p>Append <var>number</var> to <var>numbers</var>.</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-10">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-9">space characters</a>, U+002C COMMA, or
  U+003B SEMICOLON characters. This skips past the delimiter.</p>
      </li></ol>
     </li><li data-md="">
      <p>Return <var>numbers</var>.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.4.4.7" id="lists-of-dimensions"><span class="secno">2.4.4.7. </span><span class="content">Lists of dimensions</span><a class="self-link" href="infrastructure.html#lists-of-dimensions"></a></h5>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="rules-for-parsing-a-list-of-dimensions">rules for parsing a list of dimensions</dfn> are as follows. These rules return a list
  of zero or more pairs consisting of a number and a unit, the unit being one of <i>percentage</i>, <i>relative</i>, and <i>absolute</i>.</p>
    <ol>
     <li data-md="">
      <p>Let raw input be the string being parsed.</p>
     </li><li data-md="">
      <p>If the last character in <var>raw input</var> is a U+002C COMMA character (,), then remove
  that character from <var>raw input</var>.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#split-a-string-on-commas" id="ref-for-split-a-string-on-commas-2">Split the string <var>raw input</var> on commas</a>. Let <var>raw tokens</var> be the
  resulting list of tokens.</p>
     </li><li data-md="">
      <p>Let <var>result</var> be an empty list of number/unit pairs.</p>
     </li><li data-md="">
      <p>For each token in <var>raw tokens</var>, run the following substeps:</p>
      <ol>
       <li data-md="">
        <p>Let <var>input</var> be the token.</p>
       </li><li data-md="">
        <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the
  start of the string.</p>
       </li><li data-md="">
        <p>Let <var>value</var> be the number 0.</p>
       </li><li data-md="">
        <p>Let <var>unit</var> be <i>absolute</i>.</p>
       </li><li data-md="">
        <p>If position is past the end of input, set unit to relative and jump to the last substep.</p>
       </li><li data-md="">
        <p>If the character at <var>position</var> is an <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-21">ASCII digit</a>, <a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-11">collect a sequence
  of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-22">ASCII digits</a>, interpret the resulting sequence as an
  integer in base ten, and increment <var>value</var> by that integer.</p>
       </li><li data-md="">
        <p>If the character at <var>position</var> is a U+002E FULL STOP character (.), run these
  substeps:</p>
        <ol>
         <li data-md="">
          <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-12">Collect a sequence of characters</a> consisting of <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-10">space characters</a> and <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-23">ASCII digits</a>. Let <var>s</var> be the resulting sequence.</p>
         </li><li data-md="">
          <p>Remove all <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-11">space characters</a> in <var>s</var>.</p>
         </li><li data-md="">
          <p>If <var>s</var> is not the empty string, run these subsubsteps:</p>
          <ol>
           <li data-md="">
            <p>Let <var>length</var> be the number of characters in <var>s</var> (after the
  spaces were removed).</p>
           </li><li data-md="">
            <p>Let <var>fraction</var> be the result of interpreting <var>s</var> as a base-ten
  integer, and then dividing that number by 10<sup><var>length</var></sup>.</p>
           </li><li data-md="">
            <p>Increment <var>value</var> by <var>fraction</var>.</p>
          </li></ol>
        </li></ol>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="infrastructure.html#skip-whitespace" id="ref-for-skip-whitespace-4">Skip whitespace</a>.</p>
       </li><li data-md="">
        <p>If the character at <var>position</var> is a U+0025 PERCENT SIGN character (%), then set <var>unit</var> to <i>percentage</i>.</p>
        <p>Otherwise, if the character at <var>position</var> is a U+002A ASTERISK character (*),
  then set <var>unit</var> to <i>relative</i>.</p>
       </li><li data-md="">
        <p>Add an entry to <var>result</var> consisting of the number given by <var>value</var> and
  the unit given by <var>unit</var>.</p>
      </li></ol>
     </li><li data-md="">
      <p>Return the list <var>result</var>.</p>
    </li></ol>
    <h4 class="heading settled" data-level="2.4.5" id="dates-and-times"><span class="secno">2.4.5. </span><span class="content">Dates and times</span><a class="self-link" href="infrastructure.html#dates-and-times"></a></h4>
    <div class="note" role="note">
      This specification <em>encodes</em> dates and times according to a common subset of the <a data-link-type="biblio" href="references.html#biblio-iso8601">[ISO8601]</a> standard for dates. 
     <p>This means that encoded dates will look like 1582-03-01, 0033-03-27, or 2016-03-01, and date-times will look like
    1929-11-13T19:00Z, 0325-06-03T00:21+10:30. The format is approximately YYYY-MM-DDTHH:MM:SS.DD±HH:MM, although some
    parts are optional, for example to express a month and day as in a birthday, a time without time-zone information,
    and the like.</p>
     <p>Times are expressed using the 24-hour clock, and it is as error to express leap seconds.</p>
     <p>Dates are expressed in the <a data-link-type="dfn" href="infrastructure.html#proleptic-gregorian-calendar" id="ref-for-proleptic-gregorian-calendar-1">proleptic Gregorian calendar</a> between the proleptic year 0000, and the year</p>
     <ol start="9999">
      <li data-md="">
       <p>Other years cannot be encoded.</p>
     </li></ol>
     <p>The <a data-link-type="dfn" href="infrastructure.html#proleptic-gregorian-calendar" id="ref-for-proleptic-gregorian-calendar-2">proleptic Gregorian calendar</a> is the calendar most common globally since around 1950, and is
    likely to be understood by almost everyone for dates between the years 1950 and 9999, and for many
    people for dates in the last few decades or centuries.</p>
     <p>The Gregorian calendar was adopted officially in different countries at different times, between
    the years 1582 when it was proposed by Pope Gregory XIII as a replacement for the Julian calendar, and
    1949 when it was adopted by the People’s republic of China.</p>
     <p>For most practical purposes, dealing with the present, recent past, or the next few thousand years,
    this will work without problems. For dates before the adoption of the Gregorian Calendar - for example
    prior to 1917 in Russia or Turkey, prior to 1752 in Britain or the then British colonies of America,
    or prior to 1582 in Spain, the Spanish colonies in America, and the rest of the world, dates will not
    match those written at the time.</p>
     <p>The use of the Gregorian calendar as an underlying encoding is a somewhat arbitrary choice. Many other
    calendars were or are in use, and the interested reader should look for information on the Web.</p>
     <p>See also the discussion of <a href="sec-forms.html#date-time-and-number-formats">date, time, and number formats</a> in forms (for authors), <a href="sec-forms.html#implementation-notes-regarding-localization-of-form-controls">implementation
    notes regarding localization of form controls</a>, and the <code><a data-link-type="element" href="textlevel-semantics.html#elementdef-time" id="ref-for-elementdef-time-1">time</a></code> element.</p>
    </div>
    <p>In the algorithms below, the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="number-of-days-in-month-month-of-year-year">number of days in month <var>month</var> of year <var>year</var></dfn> is: <em>31</em> if <var>month</var> is 1, 3, 5, 7, 8, 10, or 12; <em>30</em> if <var>month</var> is 4, 6, 9, or 11; <em>29</em> if <var>month</var> is 2 and <var>year</var> is a number divisible by 400, or if <var>year</var> is a number divisible by 4 but not by 100; and <em>28</em> otherwise. This takes
  into account leap years in the Gregorian calendar. <a data-link-type="biblio" href="references.html#biblio-gregorian">[GREGORIAN]</a></p>
    <p>When <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-24">ASCII digits</a> are used in the date and time syntaxes defined in this section, they
  express numbers in base ten.</p>
    <p class="note" role="note"> While the formats described here are intended to be subsets of the corresponding ISO8601
    formats, this specification defines parsing rules in much more detail than ISO8601.
    Implementors are therefore encouraged to carefully examine any date parsing libraries before
    using them to implement the parsing rules described below; ISO8601 libraries might not parse
    dates and times in exactly the same manner. <a data-link-type="biblio" href="references.html#biblio-iso8601">[ISO8601]</a> </p>
    <p>Where this specification refers to the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="proleptic-gregorian-calendar">proleptic Gregorian calendar</dfn>, it means the
  modern Gregorian calendar, extrapolated backwards to year 1. A date in the <a data-link-type="dfn" href="infrastructure.html#proleptic-gregorian-calendar" id="ref-for-proleptic-gregorian-calendar-3">proleptic Gregorian calendar</a>, sometimes explicitly referred to as a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="proleptic-gregorian-date">proleptic-Gregorian date</dfn>, is one that is described using that calendar even if that
  calendar was not in use at the time (or place) in question. <a data-link-type="biblio" href="references.html#biblio-gregorian">[GREGORIAN]</a></p>
    <h5 class="heading settled" data-level="2.4.5.1" id="months"><span class="secno">2.4.5.1. </span><span class="content">Months</span><a class="self-link" href="infrastructure.html#months"></a></h5>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="month">month</dfn> consists of a specific <a data-link-type="dfn" href="infrastructure.html#proleptic-gregorian-date" id="ref-for-proleptic-gregorian-date-1">proleptic-Gregorian date</a> with no time-zone
  information and no date information beyond a year and a month. <a data-link-type="biblio" href="references.html#biblio-gregorian">[GREGORIAN]</a></p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-month-string">valid month string</dfn> representing a year <var>year</var> and month <var>month</var> if it consists of the following components in the given order:</p>
    <ol>
     <li data-md="">
      <p>Four or more <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-25">ASCII digits</a>, representing <var>year</var>, where <var>year</var>&nbsp;&gt;&nbsp;0</p>
     </li><li data-md="">
      <p>A U+002D HYPHEN-MINUS character (-)</p>
     </li><li data-md="">
      <p>Two <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-26">ASCII digits</a>, representing the month <var>month</var>, in the range
  1&nbsp;≤&nbsp;<var>month</var>&nbsp;≤&nbsp;12</p>
    </li></ol>
    <p class="example" id="example-7bd28a2c"><a class="self-link" href="infrastructure.html#example-7bd28a2c"></a> For example, February 2005 is encoded 2005-02, and March of the year 33AD (as a proleptic
    gregorian date) is encoded <code>0033-03</code>. The expression <code>325-03</code> does <em>not</em> mean March in the year 325, it is an error, because it does not have 4 digits for
    the year. </p>
    <p>The rules to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="parsing a month string|parse a month string|parsing a month" data-noexport="" id="parsing-a-month-string">parse a month string</dfn> are as follows. This will return either a year and
  month, or nothing. If at any point the algorithm says that it "fails", this means that it is
  aborted at that point and returns nothing.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start
  of the string.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#parse-a-month-component" id="ref-for-parse-a-month-component-1">Parse a month component</a> to obtain <var>year</var> and <var>month</var>. If this
  returns nothing, then fail.</p>
     </li><li data-md="">
      <p>If <var>position</var> is <em>not</em> beyond the end of <var>input</var>, then fail.</p>
     </li><li data-md="">
      <p>Return <var>year</var> and <var>month</var>.</p>
    </li></ol>
    <p>The rules to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="parse-a-month-component">parse a month component</dfn>, given an <var>input</var> string and a <var>position</var>, are as follows. This will return either a year and a month, or nothing. If
  at any point the algorithm says that it "fails", this means that it is aborted at that point and
  returns nothing.</p>
    <ol>
     <li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-13">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-27">ASCII digits</a>. If the collected
  sequence is not at least four characters long, then fail. Otherwise, interpret the resulting
  sequence as a base-ten integer. Let that number be the <var>year</var>.</p>
     </li><li data-md="">
      <p>If <var>year</var> is not a number greater than zero, then fail.</p>
     </li><li data-md="">
      <p>If <var>position</var> is beyond the end of <var>input</var> or if the character at <var>position</var> is not a U+002D HYPHEN-MINUS character, then fail. Otherwise, move <var>position</var> forwards one character.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-14">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-28">ASCII digits</a>. If the collected
  sequence is not exactly two characters long, then fail. Otherwise, interpret the resulting
  sequence as a base-ten integer. Let that number be the <var>month</var>.</p>
     </li><li data-md="">
      <p>If <var>month</var> is not a number in the range
  1&nbsp;≤&nbsp;<var>month</var>&nbsp;≤&nbsp;12, then fail.</p>
     </li><li data-md="">
      <p>Return <var>year</var> and <var>month</var>.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.4.5.2" id="sec-dates"><span class="secno">2.4.5.2. </span><span class="content">Dates</span><a class="self-link" href="infrastructure.html#sec-dates"></a></h5>
    <p>A <dfn class="dfn-paneled" data-dfn-for="dates" data-dfn-type="dfn" data-lt="date|dates" data-noexport="" id="dates-date">date</dfn> consists of a specific <a data-link-type="dfn" href="infrastructure.html#proleptic-gregorian-date" id="ref-for-proleptic-gregorian-date-2">proleptic-Gregorian date</a> with no time-zone
  information, consisting of a year, a month, and a day. <a data-link-type="biblio" href="references.html#biblio-gregorian">[GREGORIAN]</a></p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-date-string">valid date string</dfn> representing a year <var>year</var>, month <var>month</var>, and day <var>day</var> if it consists of the following components in the given
  order:</p>
    <ol>
     <li data-md="">
      <p>A <a data-link-type="dfn" href="infrastructure.html#valid-month-string" id="ref-for-valid-month-string-1">valid month string</a>, representing <var>year</var> and <var>month</var></p>
     </li><li data-md="">
      <p>A U+002D HYPHEN-MINUS character (-)</p>
     </li><li data-md="">
      <p>Two <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-29">ASCII digits</a>, representing <var>day</var>, in the range
  1&nbsp;≤&nbsp;<var>day</var>&nbsp;≤&nbsp;<var>maxday</var> where <var>maxday</var> is
  the <a data-link-type="dfn" href="infrastructure.html#number-of-days-in-month-month-of-year-year" id="ref-for-number-of-days-in-month-month-of-year-year-1">number of days in the month <var>month</var> and year <var>year</var></a></p>
    </li></ol>
    <p class="example" id="example-d0ba887e"><a class="self-link" href="infrastructure.html#example-d0ba887e"></a> For example, 29 February 2016 is encoded 2016-02-29, and 3 March of the year 33AD (as a
    proleptic gregorian date) is encoded <code>0033-03-03</code>. The expression <code>325-03-03</code> does <em>not</em> mean 3 March in the year 325, it is an error, because
    it does not have 4 digits for the year. </p>
    <p>The rules to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="parsing a date string|parse a date string|parsing a date" data-noexport="" id="parsing-a-date-string">parse a date string</dfn> are as follows. This will return either a date, or
  nothing. If at any point the algorithm says that it "fails", this means that it is aborted at
  that point and returns nothing.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start
  of the string.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#parse-a-date-component" id="ref-for-parse-a-date-component-1">Parse a date component</a> to obtain <var>year</var>, <var>month</var>, and <var>day</var>. If this returns nothing, then fail.</p>
     </li><li data-md="">
      <p>If <var>position</var> is <em>not</em> beyond the end of <var>input</var>, then fail.</p>
     </li><li data-md="">
      <p>Let <var>date</var> be the date with year <var>year</var>, month <var>month</var>, and day <var>day</var>.</p>
     </li><li data-md="">
      <p>Return <var>date</var>.</p>
    </li></ol>
    <p>The rules to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="parse-a-date-component">parse a date component</dfn>, given an <var>input</var> string and a <var>position</var>, are as follows. This will return either a year, a month, and a day, or
  nothing. If at any point the algorithm says that it "fails", this means that it is aborted at
  that point and returns nothing.</p>
    <ol>
     <li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#parse-a-month-component" id="ref-for-parse-a-month-component-2">Parse a month component</a> to obtain <var>year</var> and <var>month</var>. If this
  returns nothing, then fail.</p>
     </li><li data-md="">
      <p>Let <var>maxday</var> be the <a data-link-type="dfn" href="infrastructure.html#number-of-days-in-month-month-of-year-year" id="ref-for-number-of-days-in-month-month-of-year-year-2">number of days in month <var>month</var> of year <var>year</var></a>.</p>
     </li><li data-md="">
      <p>If <var>position</var> is beyond the end of <var>input</var> or if the character at <var>position</var> is not a U+002D HYPHEN-MINUS character, then fail. Otherwise, move <var>position</var> forwards one character.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-15">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-30">ASCII digits</a>. If the collected
  sequence is not exactly two characters long, then fail. Otherwise, interpret the resulting
  sequence as a base-ten integer. Let that number be the <var>day</var>.</p>
     </li><li data-md="">
      <p>If <var>day</var> is not a number in the range
  1&nbsp;≤&nbsp;<var>day</var>&nbsp;≤&nbsp;<var>maxday</var>, then fail.</p>
     </li><li data-md="">
      <p>Return <var>year</var>, <var>month</var>, and <var>day</var>.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.4.5.3" id="yearless-dates"><span class="secno">2.4.5.3. </span><span class="content">Yearless dates</span><a class="self-link" href="infrastructure.html#yearless-dates"></a></h5>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="yearless-date">yearless date</dfn> consists of a Gregorian month and a
  day within that month, but with no associated year. <a data-link-type="biblio" href="references.html#biblio-gregorian">[GREGORIAN]</a></p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-yearless-date-string">valid yearless date string</dfn> representing a month <var>month</var> and a
  day <var>day</var> if it consists of the following components in the given order:</p>
    <ol>
     <li data-md="">
      <p>Optionally, two U+002D HYPHEN-MINUS characters (-)</p>
     </li><li data-md="">
      <p>Two <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-31">ASCII digits</a>, representing the month <var>month</var>, in the range
  1&nbsp;≤&nbsp;<var>month</var>&nbsp;≤&nbsp;12</p>
     </li><li data-md="">
      <p>A U+002D HYPHEN-MINUS character (-)</p>
     </li><li data-md="">
      <p>Two <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-32">ASCII digits</a>, representing <var>day</var>, in the range
  1&nbsp;≤&nbsp;<var>day</var>&nbsp;≤&nbsp;<var>maxday</var> where <var>maxday</var> is
  the <a data-link-type="dfn" href="infrastructure.html#number-of-days-in-month-month-of-year-year" id="ref-for-number-of-days-in-month-month-of-year-year-3">number of days</a> in the month <var>month</var> and any arbitrary leap year (e.g., 4 or
  2000)</p>
    </li></ol>
    <p class="note" role="note"> In other words, if the <var>month</var> is "<code>02</code>", meaning February, then the day can
    be 29, as if the year was a leap year. </p>
    <p class="example" id="example-dcdbb829"><a class="self-link" href="infrastructure.html#example-dcdbb829"></a> For example, 29 February is encoded <code>02-29</code>, and 3 March is encoded <code>03-03</code>. </p>
    <p>The rules to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="parsing a yearless date string|parse a yearless date string" data-noexport="" id="parsing-a-yearless-date-string">parse a yearless date string</dfn> are as follows. This will return either a
  month and a day, or nothing. If at any point the algorithm says that it "fails", this means that
  it is aborted at that point and returns nothing.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start
  of the string.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#parse-a-yearless-date-component" id="ref-for-parse-a-yearless-date-component-1">Parse a yearless date component</a> to obtain <var>month</var> and <var>day</var>. If this
  returns nothing, then fail.</p>
     </li><li data-md="">
      <p>If <var>position</var> is <em>not</em> beyond the end of <var>input</var>, then fail.</p>
     </li><li data-md="">
      <p>Return <var>month</var> and <var>day</var>.</p>
    </li></ol>
    <p>The rules to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="parse-a-yearless-date-component">parse a yearless date component</dfn>, given an <var>input</var> string and a <var>position</var>, are as follows. This will return either a month and a day, or nothing. If
  at any point the algorithm says that it "fails", this means that it is aborted at that point and
  returns nothing.</p>
    <ol>
     <li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-16">Collect a sequence of characters</a> that are U+002D HYPHEN-MINUS characters (-). If the
  collected sequence is not exactly zero or two characters long, then fail.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-17">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-33">ASCII digits</a>. If the collected
  sequence is not exactly two characters long, then fail. Otherwise, interpret the resulting
  sequence as a base-ten integer. Let that number be the <var>month</var>.</p>
     </li><li data-md="">
      <p>If <var>month</var> is not a number in the range
  1&nbsp;≤&nbsp;<var>month</var>&nbsp;≤&nbsp;12, then fail.</p>
     </li><li data-md="">
      <p>Let <var>maxday</var> be the <a data-link-type="dfn" href="infrastructure.html#number-of-days-in-month-month-of-year-year" id="ref-for-number-of-days-in-month-month-of-year-year-4">number of days</a> in month <var>month</var> of any arbitrary
  leap year (e.g., 4 or 2000).</p>
     </li><li data-md="">
      <p>If <var>position</var> is beyond the end of <var>input</var> or if the character at <var>position</var> is not a U+002D HYPHEN-MINUS character, then fail. Otherwise, move <var>position</var> forwards one character.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-18">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-34">ASCII digits</a>. If the collected
  sequence is not exactly two characters long, then fail. Otherwise, interpret the resulting
  sequence as a base-ten integer. Let that number be the <var>day</var>.</p>
     </li><li data-md="">
      <p>If <var>day</var> is not a number in the range
  1&nbsp;≤&nbsp;<var>day</var>&nbsp;≤&nbsp;<var>maxday</var>, then fail.</p>
     </li><li data-md="">
      <p>Return <var>month</var> and <var>day</var>.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.4.5.4" id="times"><span class="secno">2.4.5.4. </span><span class="content">Times</span><a class="self-link" href="infrastructure.html#times"></a></h5>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="time">time</dfn> consists of a specific time with no time-zone information, consisting of an
  hour, a minute, a second, and a fraction of a second.</p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-time-string">valid time string</dfn> representing an hour <var>hour</var>, a minute <var>minute</var>, and a second <var>second</var> if it consists of the following components in
  the given order:</p>
    <ol>
     <li data-md="">
      <p>Two <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-35">ASCII digits</a>, representing <var>hour</var>, in the range
  0&nbsp;≤&nbsp;<var>hour</var>&nbsp;≤&nbsp;23</p>
     </li><li data-md="">
      <p>A U+003A COLON character (:)</p>
     </li><li data-md="">
      <p>Two <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-36">ASCII digits</a>, representing <var>minute</var>, in the range
  0&nbsp;≤&nbsp;<var>minute</var>&nbsp;≤&nbsp;59</p>
     </li><li data-md="">
      <p>If <var>second</var> is non-zero, or optionally if <var>second</var> is zero:</p>
      <ol>
       <li data-md="">
        <p>A U+003A COLON character (:)</p>
       </li><li data-md="">
        <p>Two <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-37">ASCII digits</a>, representing the integer part of <var>second</var>, in the
  range 0&nbsp;≤&nbsp;<var>s</var>&nbsp;≤&nbsp;59</p>
       </li><li data-md="">
        <p>If <var>second</var> is not an integer, or optionally if <var>second</var> is an integer:</p>
        <ol>
         <li data-md="">
          <p>A 002E FULL STOP character (.)</p>
         </li><li data-md="">
          <p>One, two, or three <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-38">ASCII digits</a>, representing the fractional part of <var>second</var></p>
        </li></ol>
      </li></ol>
    </li></ol>
    <p class="note" role="note"> The <var>second</var> component cannot be 60 or 61; leap seconds cannot be represented. </p>
    <p class="example" id="example-ba33dc39"><a class="self-link" href="infrastructure.html#example-ba33dc39"></a> Times are encoded using the 24 hour clock, with optional seconds, and optional decimal fractions
  of seconds. Thus 7.45pm is encoded as <code>19:45</code>. Note that parsing that time will return
  19:45:00, or 7.45pm and zero seconds. <code>19:45:45.456</code> is 456 thousandths of
  a second after 7.45pm and 45 seconds. </p>
    <p>The rules to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="parsing a time string|parse a time string|parsing a time" data-noexport="" id="parsing-a-time-string">parse a time string</dfn> are as follows. This will return either a time, or
  nothing. If at any point the algorithm says that it "fails", this means that it is aborted at
  that point and returns nothing.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start
  of the string.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#parse-a-time-component" id="ref-for-parse-a-time-component-1">Parse a time component</a> to obtain <var>hour</var>, <var>minute</var>, and <var>second</var>. If this returns nothing, then fail.</p>
     </li><li data-md="">
      <p>If <var>position</var> is <em>not</em> beyond the end of <var>input</var>, then fail.</p>
     </li><li data-md="">
      <p>Let <var>time</var> be the time with hour <var>hour</var>, minute <var>minute</var>, and
  second <var>second</var>.</p>
     </li><li data-md="">
      <p>Return <var>time</var>.</p>
    </li></ol>
    <p>The rules to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="parse-a-time-component">parse a time component</dfn>, given an <var>input</var> string and a <var>position</var>, are as follows. This will return either an hour, a minute, and a second, or
  nothing. If at any point the algorithm says that it "fails", this means that it is aborted at
  that point and returns nothing.</p>
    <ol>
     <li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-19">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-39">ASCII digits</a>. If the
  collected sequence is not exactly two characters long, then fail. Otherwise, interpret the
  resulting sequence as a base-ten integer. Let that number be the <var>hour</var>.</p>
     </li><li data-md="">
      <p>If <var>hour</var> is not a number in the range
  0&nbsp;≤&nbsp;<var>hour</var>&nbsp;≤&nbsp;23, then fail.</p>
     </li><li data-md="">
      <p>If <var>position</var> is beyond the end of <var>input</var> or if the
  character at <var>position</var> is not a U+003A COLON character, then fail. Otherwise,
  move <var>position</var> forwards one character.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-20">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-40">ASCII digits</a>. If the collected
  sequence is not exactly two characters long, then fail. Otherwise, interpret the resulting
  sequence as a base-ten integer. Let that number be the <var>minute</var>.</p>
     </li><li data-md="">
      <p>If <var>minute</var> is not a number in the range
  0&nbsp;≤&nbsp;<var>minute</var>&nbsp;≤&nbsp;59, then fail.</p>
     </li><li data-md="">
      <p>Let <var>second</var> be a string with the value "0".</p>
     </li><li data-md="">
      <p>If <var>position</var> is not beyond the end of <var>input</var> and the character at <var>position</var> is a U+003A COLON, then run these substeps:</p>
      <ol>
       <li data-md="">
        <p>Advance <var>position</var> to the next character in <var>input</var>.</p>
       </li><li data-md="">
        <p>If <var>position</var> is beyond the end of <var>input</var>, or at the last character in <var>input</var>, or if the next <em>two</em> characters in <var>input</var> starting at <var>position</var> are not both <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-41">ASCII digits</a>, then fail.</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-21">Collect a sequence of characters</a> that are either <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-42">ASCII digits</a> or U+002E
  FULL STOP characters. If the collected sequence is three characters long, or if it is
  longer than three characters long and the third character is not a U+002E FULL STOP
  character, or if it has more than one U+002E FULL STOP character, then fail. Otherwise,
  let <var>second</var> be the collected string.</p>
      </li></ol>
     </li><li data-md="">
      <p>Interpret <var>second</var> as a base-ten number (possibly with a fractional part). Let <var>second</var> be that number instead of the string version.</p>
     </li><li data-md="">
      <p>If <var>second</var> is not a number in the range
  0&nbsp;≤&nbsp;<var>second</var>&nbsp;&lt;&nbsp;60, then fail.</p>
     </li><li data-md="">
      <p>Return <var>hour</var>, <var>minute</var>, and <var>second</var>.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.4.5.5" id="floating-dates-and-times"><span class="secno">2.4.5.5. </span><span class="content">Floating dates and times</span><a class="self-link" href="infrastructure.html#floating-dates-and-times"></a></h5>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="floating-date-and-time">floating date and time</dfn> consists of a specific <a data-link-type="dfn" href="infrastructure.html#proleptic-gregorian-date" id="ref-for-proleptic-gregorian-date-3">proleptic-Gregorian date</a>,
  consisting of a year, a month, and a day, and a time, consisting of an hour, a minute, a second,
  and a fraction of a second, but expressed without a time zone. <a data-link-type="biblio" href="references.html#biblio-gregorian">[GREGORIAN]</a></p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-floating-date-and-time-string">valid floating date and time string</dfn> representing a date and time if it
  consists of the following components in the given order:</p>
    <ol>
     <li data-md="">
      <p>A <a data-link-type="dfn" href="infrastructure.html#valid-date-string" id="ref-for-valid-date-string-1">valid date string</a> representing the date</p>
     </li><li data-md="">
      <p>A U+0054 LATIN CAPITAL LETTER T character (T) or a U+0020 SPACE character</p>
     </li><li data-md="">
      <p>A <a data-link-type="dfn" href="infrastructure.html#valid-time-string" id="ref-for-valid-time-string-1">valid time string</a> representing the time</p>
    </li></ol>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-normalized-floating-date-and-time-string">valid normalized floating date and time string</dfn> representing a date and
  time if it consists of the following components in the given order:</p>
    <ol>
     <li data-md="">
      <p>A <a data-link-type="dfn" href="infrastructure.html#valid-date-string" id="ref-for-valid-date-string-2">valid date string</a> representing the date</p>
     </li><li data-md="">
      <p>A U+0054 LATIN CAPITAL LETTER T character (T)</p>
     </li><li data-md="">
      <p>A <a data-link-type="dfn" href="infrastructure.html#valid-time-string" id="ref-for-valid-time-string-2">valid time string</a> representing the time, expressed as the shortest possible string for
  the given time (e.g., omitting the seconds component entirely if the given time is zero seconds
  past the minute)</p>
    </li></ol>
    <p>The rules to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="parsing a floating date and time string|parse a floating date and time string|parsing a floating date and time" data-noexport="" id="parsing-a-floating-date-and-time-string">parse a floating date and time string</dfn> are as follows. This will return
  either a date and time, or nothing. If at any point the algorithm says that it "fails", this
  means that it is aborted at that point and returns nothing.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start
  of the string.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#parse-a-date-component" id="ref-for-parse-a-date-component-2">Parse a date component</a> to obtain <var>year</var>, <var>month</var>, and <var>day</var>. If this returns nothing, then fail.</p>
     </li><li data-md="">
      <p>If <var>position</var> is beyond the end of <var>input</var> or if the character at <var>position</var> is neither a U+0054 LATIN CAPITAL LETTER T character (T) nor a U+0020
  SPACE character, then fail. Otherwise, move <var>position</var> forwards one character.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#parse-a-time-component" id="ref-for-parse-a-time-component-2">Parse a time component</a> to obtain <var>hour</var>, <var>minute</var>, and <var>second</var>. If this returns nothing, then fail.</p>
     </li><li data-md="">
      <p>If <var>position</var> is <em>not</em> beyond the end of <var>input</var>, then fail.</p>
     </li><li data-md="">
      <p>Let <var>date</var> be the date with year <var>year</var>, month <var>month</var>, and day <var>day</var>.</p>
     </li><li data-md="">
      <p>Let <var>time</var> be the time with hour <var>hour</var>, minute <var>minute</var>, and
  second <var>second</var>.</p>
     </li><li data-md="">
      <p>Return <var>date</var> and <var>time</var>.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.4.5.6" id="time-zones"><span class="secno">2.4.5.6. </span><span class="content">Time zones</span><a class="self-link" href="infrastructure.html#time-zones"></a></h5>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="time zone|time-zone offset" data-noexport="" id="time-zone">time-zone offset</dfn> consists of a signed number of hours and minutes.</p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-time-zone-offset-string">valid time-zone offset string</dfn> representing a time-zone offset if it
  consists of either:</p>
    <ul>
     <li data-md="">
      <p>A U+005A LATIN CAPITAL LETTER Z character (Z), allowed only if the time zone is UTC</p>
     </li><li data-md="">
      <p>Or, the following components, in the given order:</p>
      <ol>
       <li data-md="">
        <p>Either a U+002B PLUS SIGN character (+) or, if the time-zone offset is not zero, a U+002D
HYPHEN-MINUS character (-), representing the sign of the time-zone offset</p>
       </li><li data-md="">
        <p>Two <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-43">ASCII digits</a>, representing the hours component <var>hour</var> of the
time-zone offset, in the range 0&nbsp;≤&nbsp;<var>hour</var>&nbsp;≤&nbsp;23</p>
       </li><li data-md="">
        <p>Optionally, a U+003A COLON character (:)</p>
       </li><li data-md="">
        <p>Two <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-44">ASCII digits</a>, representing the minutes component <var>minute</var> of the
time-zone offset, in the range 0&nbsp;≤&nbsp;<var>minute</var>&nbsp;≤&nbsp;59</p>
      </li></ol>
    </li></ul>
    <p class="note" role="note"> This format allows for time-zone offsets from -23:59 to +23:59. In practice, however, right now
    the range of offsets of actual time zones is -12:00 to +14:00, and the minutes component of
    offsets of actual time zones is always either 00, 30, or 45. There is no guarantee that this
    will remain so forever, however; time zones are changed by countries at will and do not follow a
    standard. </p>
    <p class="note" role="note"> See also the usage notes and examples in the <a data-link-type="dfn" href="infrastructure.html#global-date-and-time" id="ref-for-global-date-and-time-1">global date and time</a> section below for
    details on using time-zone offsets with historical times that predate the formation of formal
    time zones. </p>
    <p>The rules to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="parsing a time-zone offset string|parse a time-zone offset string" data-noexport="" id="parsing-a-time-zone-offset-string">parse a time-zone offset string</dfn> are as follows. This will return either
  a time-zone offset, or nothing. If at any point the algorithm says that it "fails", this means
  that it is aborted at that point and returns nothing.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start
  of the string.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#parse-a-time-zone-offset-component" id="ref-for-parse-a-time-zone-offset-component-1">Parse a time-zone offset component</a> to obtain <var>timezone<sub>hours</sub></var> and <var>timezone<sub>minutes</sub></var>. If this returns nothing, then fail.</p>
     </li><li data-md="">
      <p>If <var>position</var> is <em>not</em> beyond the end of <var>input</var>, then fail.</p>
     </li><li data-md="">
      <p>Return the time-zone offset that is <var>timezone<sub>hours</sub></var> hours and <var>timezone<sub>minutes</sub></var> minutes from UTC.</p>
    </li></ol>
    <p>The rules to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="parse-a-time-zone-offset-component">parse a time-zone offset component</dfn>, given an <var>input</var> string and
  a <var>position</var>, are as follows. This will return either time-zone hours and time-zone
  minutes, or nothing. If at any point the algorithm says that it "fails", this means that it is
  aborted at that point and returns nothing.</p>
    <ol>
     <li data-md="">
      <p>If the character at <var>position</var> is a U+005A LATIN CAPITAL LETTER Z character (Z), then:</p>
      <ol>
       <li data-md="">
        <p>Let <var>timezone<sub>hours</sub></var> be 0.</p>
       </li><li data-md="">
        <p>Let <var>timezone<sub>minutes</sub></var> be 0.</p>
       </li><li data-md="">
        <p>Advance <var>position</var> to the next character in <var>input</var>.</p>
      </li></ol>
      <p>Otherwise, if the character at <var>position</var> is either a U+002B PLUS SIGN (+) or a
  U+002D HYPHEN-MINUS (-), then:</p>
      <ol>
       <li data-md="">
        <p>If the character at <var>position</var> is a U+002B PLUS SIGN (+), let <var>sign</var> be
  "positive". Otherwise, it’s a U+002D HYPHEN-MINUS (-); let <var>sign</var> be
  "negative".</p>
       </li><li data-md="">
        <p>Advance <var>position</var> to the next character in <var>input</var>.</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-22">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-45">ASCII digits</a>. Let <var>s</var> be
  the collected sequence.</p>
       </li><li data-md="">
        <p>If <var>s</var> is exactly two characters long, then run these substeps:</p>
        <ol>
         <li data-md="">
          <p>Interpret <var>s</var> as a base-ten integer. Let that number be the <var>timezone<sub>hours</sub></var>.</p>
         </li><li data-md="">
          <p>If <var>position</var> is beyond the end of <var>input</var> or if the character at <var>position</var> is not a U+003A COLON character, then fail. Otherwise, move <var>position</var> forwards one character.</p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-23">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-46">ASCII digits</a>. If the
  collected sequence is not exactly two characters long, then fail. Otherwise,
  interpret the resulting sequence as a base-ten integer. Let that number be the <var>timezone<sub>minutes</sub></var>.</p>
        </li></ol>
        <p>If <var>s</var> is exactly four characters long, then run these substeps:</p>
        <ol>
         <li data-md="">
          <p>Interpret the first two characters of <var>s</var> as a base-ten integer. Let that
  number be the <var>timezone<sub>hours</sub></var>.</p>
         </li><li data-md="">
          <p>Interpret the last two characters of <var>s</var> as a base-ten integer. Let that
  number be the <var>timezone<sub>minutes</sub></var>.</p>
        </li></ol>
        <p>Otherwise, fail.</p>
       </li><li data-md="">
        <p>If <var>timezone<sub>hours</sub></var> is not a number in the range
  0&nbsp;≤&nbsp;<var>timezone<sub>hours</sub></var>&nbsp;≤&nbsp;23, then fail.</p>
       </li><li data-md="">
        <p>If <var>sign</var> is "negative", then negate <var>timezone<sub>hours</sub></var>.</p>
       </li><li data-md="">
        <p>If <var>timezone<sub>minutes</sub></var> is not a number in the range
  0&nbsp;≤&nbsp;<var>timezone<sub>minutes</sub></var>&nbsp;≤&nbsp;59, then fail.</p>
       </li><li data-md="">
        <p>If <var>sign</var> is "negative", then negate <var>timezone<sub>minutes</sub></var>.</p>
      </li></ol>
      <p>Otherwise, fail.</p>
     </li><li data-md="">
      <p>Return <var>timezone<sub>hours</sub></var> and <var>timezone<sub>minutes</sub></var>.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.4.5.7" id="global-dates-and-times"><span class="secno">2.4.5.7. </span><span class="content">Global dates and times</span><a class="self-link" href="infrastructure.html#global-dates-and-times"></a></h5>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="global-date-and-time">global date and time</dfn> consists of a specific <a data-link-type="dfn" href="infrastructure.html#proleptic-gregorian-date" id="ref-for-proleptic-gregorian-date-4">proleptic-Gregorian date</a>,
  consisting of a year, a month, and a day, and a time, consisting of an hour, a minute, a second,
  and a fraction of a second, expressed with a time-zone offset, consisting of a signed number of
  hours and minutes. <a data-link-type="biblio" href="references.html#biblio-gregorian">[GREGORIAN]</a></p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-global-date-and-time-string">valid global date and time string</dfn> representing a date, time, and a
  time-zone offset if it consists of the following components in the given order:</p>
    <ol>
     <li data-md="">
      <p>A <a data-link-type="dfn" href="infrastructure.html#valid-date-string" id="ref-for-valid-date-string-3">valid date string</a> representing the date</p>
     </li><li data-md="">
      <p>A U+0054 LATIN CAPITAL LETTER T character (T) or a U+0020 SPACE character</p>
     </li><li data-md="">
      <p>A <a data-link-type="dfn" href="infrastructure.html#valid-time-string" id="ref-for-valid-time-string-3">valid time string</a> representing the time</p>
     </li><li data-md="">
      <p>A <a data-link-type="dfn" href="infrastructure.html#valid-time-zone-offset-string" id="ref-for-valid-time-zone-offset-string-1">valid time-zone offset string</a> representing the time-zone offset</p>
    </li></ol>
    <p>Times in dates before the formation of UTC in the mid twentieth century must be expressed and
  interpreted in terms of UT1 (contemporary Earth mean solar time at the 0° longitude), not UTC
  (the approximation of UT1 that ticks in SI seconds). Time before the formation of time zones must
  be expressed and interpreted as UT1 times with explicit time zones that approximate the
  contemporary difference between the appropriate local time and the time observed at the location
  of Greenwich, London.</p>
    <div class="example" id="example-d8062d20">
     <a class="self-link" href="infrastructure.html#example-d8062d20"></a> The following are some examples of dates written as <a data-link-type="dfn" href="infrastructure.html#valid-global-date-and-time-string" id="ref-for-valid-global-date-and-time-string-1">valid global date and time strings</a>. 
     <dl>
      <dt data-md="">
       <p>"<code>0037-12-13 00:00Z</code>"</p>
      </dt><dd data-md="">
       <p>Midnight in areas using London time on the birthday of Nero (the Roman Emperor). See below
for further discussion on which date this actually corresponds to.</p>
      </dd><dt data-md="">
       <p>"<code>1979-10-14T12:00:00.001-04:00</code>"</p>
      </dt><dd data-md="">
       <p>One millisecond after noon on October 14th 1979, in the time zone in use on the east coast of
the USA during daylight saving time.</p>
      </dd><dt data-md="">
       <p>"<code>8592-01-01T02:09+02:09</code>"</p>
      </dt><dd data-md="">
       <p>Midnight UTC on the 1st of January, 8592. The time zone associated with that time is two
hours and nine minutes ahead of UTC, which is not currently a real time zone, but is
nonetheless allowed.</p>
     </dd></dl>
     <p>Several things are notable about these dates:</p>
     <ul>
      <li data-md="">
       <p>Years with fewer than four digits have to be zero-padded. The date "37-12-13" would not be a
valid date.</p>
      </li><li data-md="">
       <p>If the "<code>T</code>" is replaced by a space, it must be a single space character. The
string "<code>2001-12-21&nbsp;&nbsp;12:00Z</code>" (with two spaces between the components)
would not be parsed successfully.</p>
      </li><li data-md="">
       <p>To unambiguously identify a moment in time prior to the introduction of the Gregorian calendar
(insofar as moments in time before the formation of UTC can be unambiguously identified),
the date has to be first converted to the Gregorian calendar from the calendar in use at the
time (e.g., from the Julian calendar). The date of Nero’s birth is the 15th of December 37,
in the Julian Calendar, which is the 13th of December 37 in the <a data-link-type="dfn" href="infrastructure.html#proleptic-gregorian-calendar" id="ref-for-proleptic-gregorian-calendar-4">proleptic Gregorian calendar</a>.</p>
      </li><li data-md="">
       <p>The time and time-zone offset components are not optional.</p>
      </li><li data-md="">
       <p>Dates before the year one can’t be represented as a datetime in this version of HTML.</p>
      </li><li data-md="">
       <p>Times of specific events in ancient times are, at best, approximations, since time was not
well coordinated or measured until relatively recent decades.</p>
      </li><li data-md="">
       <p>Time-zone offsets differ based on daylight savings time.</p>
     </li></ul>
    </div>
    <p class="note" role="note"> The zone offset is not a complete time zone specification. When working with real date and time
    values, consider using a separate field for time zone, perhaps using IANA time zone IDs. <a data-link-type="biblio" href="references.html#biblio-timezone">[TIMEZONE]</a> </p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-normalized-global-date-and-time-string">valid normalized global date and time string</dfn> representing a
  date, time, and a time-zone offset if it consists of the following components in the given order:</p>
    <ol>
     <li data-md="">
      <p>A <a data-link-type="dfn" href="infrastructure.html#valid-date-string" id="ref-for-valid-date-string-4">valid date string</a> representing the date converted to the UTC time zone</p>
     </li><li data-md="">
      <p>A U+0054 LATIN CAPITAL LETTER T character (T)</p>
     </li><li data-md="">
      <p>A <a data-link-type="dfn" href="infrastructure.html#valid-time-string" id="ref-for-valid-time-string-4">valid time string</a> representing the time converted to the UTC time zone and expressed
  as the shortest possible string for the given time (e.g., omitting the seconds component
  entirely if the given time is zero seconds past the minute)</p>
     </li><li data-md="">
      <p>A U+005A LATIN CAPITAL LETTER Z character (Z)</p>
    </li></ol>
    <p>The rules to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="parse a global date and time string|parsing a date and time" data-noexport="" id="parse-a-global-date-and-time-string">parse a global date and time string</dfn> are as follows. This will return
  either a time in UTC, with associated time-zone offset information for round-tripping or display
  purposes, or nothing. If at any point the algorithm says that it "fails", this means that it is
  aborted at that point and returns nothing.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start
  of the string.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#parse-a-date-component" id="ref-for-parse-a-date-component-3">Parse a date component</a> to obtain <var>year</var>, <var>month</var>, and <var>day</var>. If this returns nothing, then fail.</p>
     </li><li data-md="">
      <p>If <var>position</var> is beyond the end of <var>input</var> or if the character at <var>position</var> is neither a U+0054 LATIN CAPITAL LETTER T character (T) nor a U+0020
  SPACE character, then fail. Otherwise, move <var>position</var> forwards one character.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#parse-a-time-component" id="ref-for-parse-a-time-component-3">Parse a time component</a> to obtain <var>hour</var>, <var>minute</var>, and <var>second</var>. If this returns nothing, then fail.</p>
     </li><li data-md="">
      <p>If <var>position</var> is beyond the end of <var>input</var>, then fail.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#parse-a-time-zone-offset-component" id="ref-for-parse-a-time-zone-offset-component-2">Parse a time-zone offset component</a> to obtain <var>timezone<sub>hours</sub></var> and <var>timezone<sub>minutes</sub></var>. If this returns nothing, then fail.</p>
     </li><li data-md="">
      <p>If <var>position</var> is <em>not</em> beyond the end of <var>input</var>, then fail.</p>
     </li><li data-md="">
      <p>Let <var>time</var> be the moment in time at year <var>year</var>, month <var>month</var>,
  day <var>day</var>, hours <var>hour</var>, minute <var>minute</var>, second <var>second</var>, subtracting <var>timezone<sub>hours</sub></var> hours and <var>timezone<sub>minutes</sub></var> minutes. That moment in time is a moment in the UTC
  time zone.</p>
     </li><li data-md="">
      <p>Let <var>timezone</var> be <var>timezone<sub>hours</sub></var> hours and <var>timezone<sub>minutes</sub></var> minutes from UTC.</p>
     </li><li data-md="">
      <p>Return <var>time</var> and <var>timezone</var>.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.4.5.8" id="weeks"><span class="secno">2.4.5.8. </span><span class="content">Weeks</span><a class="self-link" href="infrastructure.html#weeks"></a></h5>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="week">week</dfn> consists of a week-year number and a week number representing a seven-day period
  starting on a Monday. Each week-year in this calendaring system has either 52 or 53 such seven-day
  periods, as defined below. The seven-day period starting on the Gregorian date Monday December
  29th 1969 (1969-12-29) is defined as week number 1 in week-year 1970. Consecutive weeks are
  numbered sequentially. The week before the number 1 week in a week-year is the last week in the
  previous week-year, and vice versa. <a data-link-type="biblio" href="references.html#biblio-gregorian">[GREGORIAN]</a></p>
    <p>A week-year with a number <var>year</var> has 53 weeks if it corresponds to either a year <var>year</var> in the <a data-link-type="dfn" href="infrastructure.html#proleptic-gregorian-calendar" id="ref-for-proleptic-gregorian-calendar-5">proleptic Gregorian calendar</a> that has a Thursday as its first
  day (January 1st), or a year <var>year</var> in the <a data-link-type="dfn" href="infrastructure.html#proleptic-gregorian-calendar" id="ref-for-proleptic-gregorian-calendar-6">proleptic Gregorian calendar</a> that has
  a Wednesday as its first day (January 1st) and where <var>year</var> is a number divisible by 400,
  or a number divisible by 4 but not by 100. All other week-years have 52 weeks.</p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="week-number-of-the-last-day">week number of the last day</dfn> of a week-year with 53 weeks is 53; the week number of
  the last day of a week-year with 52 weeks is 52.</p>
    <p class="note" role="note"> The week-year number of a particular day can be different than the number of the year that
    contains that day in the <a data-link-type="dfn" href="infrastructure.html#proleptic-gregorian-calendar" id="ref-for-proleptic-gregorian-calendar-7">proleptic Gregorian calendar</a>. The first week in a week-year <var>y</var> is the week that contains the first Thursday of the Gregorian year <var>y</var>. </p>
    <p class="note" role="note"> For modern purposes, a <a data-link-type="dfn" href="infrastructure.html#week" id="ref-for-week-1">week</a> as defined here is equivalent to ISO weeks as defined in
    ISO 8601. <a data-link-type="biblio" href="references.html#biblio-iso8601">[ISO8601]</a> </p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-week-string">valid week string</dfn> representing a week-year <var>year</var> and week <var>week</var> if it consists of the following components in the given order:</p>
    <p></p>
    <ol>
     <li data-md="">
      <p>Four or more <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-47">ASCII digits</a>, representing <var>year</var>, where <var>year</var>&nbsp;&gt;&nbsp;0</p>
     </li><li data-md="">
      <p>A U+002D HYPHEN-MINUS character (-)</p>
     </li><li data-md="">
      <p>A U+0057 LATIN CAPITAL LETTER W character (W)</p>
     </li><li data-md="">
      <p>Two <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-48">ASCII digits</a>, representing the week <var>week</var>, in the range
  1&nbsp;≤&nbsp;<var>week</var>&nbsp;≤&nbsp;<var>maxweek</var>, where <var>maxweek</var> is the <a data-link-type="dfn" href="infrastructure.html#week-number-of-the-last-day" id="ref-for-week-number-of-the-last-day-1">week number of the last day</a> of week-year <var>year</var></p>
    </li></ol>
    <p>The rules to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="parsing a week string|parse a week string|parsing a week" data-noexport="" id="parsing-a-week-string">parse a week string</dfn> are as follows. This will return either a week-year
  number and week number, or nothing. If at any point the algorithm says that it "fails", this
  means that it is aborted at that point and returns nothing.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start
  of the string.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-24">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-49">ASCII digits</a>. If the collected
  sequence is not at least four characters long, then fail. Otherwise, interpret the resulting
  sequence as a base-ten integer. Let that number be the <var>year</var>.</p>
     </li><li data-md="">
      <p>If <var>year</var> is not a number greater than zero, then fail.</p>
     </li><li data-md="">
      <p>If <var>position</var> is beyond the end of <var>input</var> or if the character at <var>position</var> is not a U+002D HYPHEN-MINUS character, then fail. Otherwise, move <var>position</var> forwards one character.</p>
     </li><li data-md="">
      <p>If <var>position</var> is beyond the end of <var>input</var> or if the character at <var>position</var> is not a U+0057 LATIN CAPITAL LETTER W character (W), then fail.
  Otherwise, move <var>position</var> forwards one character.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-25">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-50">ASCII digits</a>. If the collected
  sequence is not exactly two characters long, then fail. Otherwise, interpret the resulting
  sequence as a base-ten integer. Let that number be the <var>week</var>.</p>
     </li><li data-md="">
      <p>Let <var>maxweek</var> be the <a data-link-type="dfn" href="infrastructure.html#week-number-of-the-last-day" id="ref-for-week-number-of-the-last-day-2">week number of the last day</a> of year <var>year</var>.</p>
     </li><li data-md="">
      <p>If <var>week</var> is not a number in the range
  1&nbsp;≤&nbsp;<var>week</var>&nbsp;≤&nbsp;<var>maxweek</var>, then fail.</p>
     </li><li data-md="">
      <p>If <var>position</var> is <em>not</em> beyond the end of <var>input</var>, then fail.</p>
     </li><li data-md="">
      <p>Return the week-year number <var>year</var> and the week number <var>week</var>.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.4.5.9" id="durations"><span class="secno">2.4.5.9. </span><span class="content">Durations</span><a class="self-link" href="infrastructure.html#durations"></a></h5>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="duration">duration</dfn> consists of a number of seconds.</p>
    <p class="note" role="note"> Since months and seconds are not comparable (a month is not a precise number of seconds, but is
    instead a period whose exact length depends on the precise day from which it is measured) a <a data-link-type="dfn" href="infrastructure.html#duration" id="ref-for-duration-1">duration</a> as defined in this specification cannot include months (or years, which are
    equivalent to twelve months). Only durations that describe a specific number of seconds can be
    described. </p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-duration-string">valid duration string</dfn> representing a <a data-link-type="dfn" href="infrastructure.html#duration" id="ref-for-duration-2">duration</a> <var>t</var> if it
  consists of either of the following:</p>
    <ul>
     <li data-md="">
      <p>A literal U+0050 LATIN CAPITAL LETTER P character followed by one or more of the following
subcomponents, in the order given, where the number of days, hours, minutes, and seconds
corresponds to the same number of seconds as in <var>t</var>:</p>
      <ol>
       <li data-md="">
        <p>One or more <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-51">ASCII digits</a> followed by a U+0044 LATIN CAPITAL LETTER D character,
representing a number of days.</p>
       </li><li data-md="">
        <p>A U+0054 LATIN CAPITAL LETTER T character followed by one or more of the following
subcomponents, in the order given:</p>
        <ol>
         <li data-md="">
          <p>One or more <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-52">ASCII digits</a> followed by a U+0048 LATIN CAPITAL LETTER H
character, representing a number of hours.</p>
         </li><li data-md="">
          <p>One or more <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-53">ASCII digits</a> followed by a U+004D LATIN CAPITAL LETTER M
character, representing a number of minutes.</p>
         </li><li data-md="">
          <p>The following components:</p>
          <ol>
           <li data-md="">
            <p>One or more <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-54">ASCII digits</a>, representing a number of seconds.</p>
           </li><li data-md="">
            <p>Optionally, a U+002E FULL STOP character (.) followed by one, two, or three <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-55">ASCII digits</a>, representing a fraction of a second.</p>
           </li><li data-md="">
            <p>A U+0053 LATIN CAPITAL LETTER S character.</p>
          </li></ol>
        </li></ol>
      </li></ol>
      <p class="note" role="note"> This, as with a number of other date- and time-related microsyntaxes defined in this
  specification, is based on one of the formats defined in ISO 8601. <a data-link-type="biblio" href="references.html#biblio-iso8601">[ISO8601]</a> </p>
     </li><li data-md="">
      <p>One or more <a data-link-type="dfn" href="infrastructure.html#duration-time-component" id="ref-for-duration-time-component-1">duration time components</a>, each with a different <a data-link-type="dfn" href="infrastructure.html#duration-time-component-scale" id="ref-for-duration-time-component-scale-1">duration time component scale</a>, in any order; the sum of the represented seconds being
equal to the number of seconds in <var>t</var>.</p>
      <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="duration-time-component">duration time component</dfn> is a string consisting of the following components:</p>
      <ol>
       <li data-md="">
        <p>Zero or more <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-12">space characters</a>.</p>
       </li><li data-md="">
        <p>One or more <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-56">ASCII digits</a>, representing a number of time units, scaled by the <a data-link-type="dfn" href="infrastructure.html#duration-time-component-scale" id="ref-for-duration-time-component-scale-2">duration time component scale</a> specified (see below) to represent a number of
  seconds.</p>
       </li><li data-md="">
        <p>If the <a data-link-type="dfn" href="infrastructure.html#duration-time-component-scale" id="ref-for-duration-time-component-scale-3">duration time component scale</a> specified is 1 (i.e., the units are seconds),
 then, optionally, a U+002E FULL STOP character (.) followed by one, two, or three <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-57">ASCII digits</a>, representing a fraction of a second.</p>
       </li><li data-md="">
        <p>Zero or more <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-13">space characters</a>.</p>
       </li><li data-md="">
        <p>One of the following characters, representing the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="duration-time-component-scale">duration time component scale</dfn> of the time unit used in the numeric part of
  the <a data-link-type="dfn" href="infrastructure.html#duration-time-component" id="ref-for-duration-time-component-2">duration time component</a>:</p>
        <dl>
         <dt data-md="">
          <p>U+0057 LATIN CAPITAL LETTER W character</p>
         </dt><dt data-md="">
          <p>U+0077 LATIN SMALL LETTER W character</p>
         </dt><dd data-md="">
          <p>Weeks. The scale is 604800.</p>
         </dd><dt data-md="">
          <p>U+0044 LATIN CAPITAL LETTER D character</p>
         </dt><dt data-md="">
          <p>U+0064 LATIN SMALL LETTER D character</p>
         </dt><dd data-md="">
          <p>Days. The scale is 86400.</p>
         </dd><dt data-md="">
          <p>U+0048 LATIN CAPITAL LETTER H character</p>
         </dt><dt data-md="">
          <p>U+0068 LATIN SMALL LETTER H character</p>
         </dt><dd data-md="">
          <p>Hours. The scale is 3600.</p>
         </dd><dt data-md="">
          <p>U+004D LATIN CAPITAL LETTER M character</p>
         </dt><dt data-md="">
          <p>U+006D LATIN SMALL LETTER M character</p>
         </dt><dd data-md="">
          <p>Minutes. The scale is 60.</p>
         </dd><dt data-md="">
          <p>U+0053 LATIN CAPITAL LETTER S character</p>
         </dt><dt data-md="">
          <p>U+0073 LATIN SMALL LETTER S character</p>
         </dt><dd data-md="">
          <p>Seconds. The scale is 1.</p>
        </dd></dl>
       </li><li data-md="">
        <p>Zero or more <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-14">space characters</a>.</p>
      </li></ol>
      <p class="note" role="note"> This is not based on any of the formats in ISO 8601. It is intended to be a more
    human-readable alternative to the ISO 8601 duration format. </p>
    </li></ul>
    <p>The rules to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="parsing a duration string|parse a duration string" data-noexport="" id="parsing-a-duration-string">parse a duration string</dfn> are as follows. This will return either a <a data-link-type="dfn" href="infrastructure.html#duration" id="ref-for-duration-3">duration</a> or nothing. If at any point the algorithm says that it "fails", this means that
  it is aborted at that point and returns nothing.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start
  of the string.</p>
     </li><li data-md="">
      <p>Let <var>months</var>, <var>seconds</var>, and <var>component count</var> all be zero.</p>
     </li><li data-md="">
      <p>Let <var>M-disambiguator</var> be <i>minutes</i>.</p>
      <p class="note" role="note"> This flag’s other value is <i>months</i>. It is used to disambiguate the "M" unit in
    ISO8601 durations, which use the same unit for months and minutes. Months are not allowed,
    but are parsed for future compatibility and to avoid misinterpreting ISO8601 durations
    that would be valid in other contexts. </p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#skip-whitespace" id="ref-for-skip-whitespace-5">Skip whitespace</a>.</p>
     </li><li data-md="">
      <p>If <var>position</var> is past the end of <var>input</var>, then fail.</p>
     </li><li data-md="">
      <p>If the character in <var>input</var> pointed to by <var>position</var> is a U+0050 LATIN
  CAPITAL LETTER P character, then advance <var>position</var> to the next character, set <var>M-disambiguator</var> to <i>months</i>, and <a data-link-type="dfn" href="infrastructure.html#skip-whitespace" id="ref-for-skip-whitespace-6">skip whitespace</a>.</p>
     </li><li data-md="">
      <p>Run the following substeps in a loop, until a step requiring the loop to be broken or the
  entire algorithm to fail is reached:</p>
      <ol>
       <li data-md="">
        <p>Let <var>units</var> be undefined. It will be assigned one of the following values: <i>years</i>, <i>months</i>, <i>weeks</i>, <i>days</i>, <i>hours</i>, <i>minutes</i>,
  and <i>seconds</i>.</p>
       </li><li data-md="">
        <p>Let <var>next character</var> be undefined. It is used to process characters from the <var>input</var>.</p>
       </li><li data-md="">
        <p>If <var>position</var> is past the end of <var>input</var>, then break the loop.</p>
       </li><li data-md="">
        <p>If the character in <var>input</var> pointed to by <var>position</var> is a U+0054 LATIN
  CAPITAL LETTER T character, then advance <var>position</var> to the next character, set <var>M-disambiguator</var> to <i>minutes</i>, <a data-link-type="dfn" href="infrastructure.html#skip-whitespace" id="ref-for-skip-whitespace-7">skip whitespace</a>, and return to the
  top of the loop.</p>
       </li><li data-md="">
        <p>Set <var>next character</var> to the character in <var>input</var> pointed to by <var>position</var>.</p>
       </li><li data-md="">
        <p>If <var>next character</var> is a U+002E FULL STOP character (.), then let <var>N</var> equal zero. (Do not advance <var>position</var>. That is taken care of below.)</p>
        <p>Otherwise, if <var>next character</var> is an <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-58">ASCII digit</a>, then <a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-26">collect a
  sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-59">ASCII digits</a>, interpret the resulting
  sequence as a base-ten integer, and let <var>N</var> be that number.</p>
        <p>Otherwise <var>next character</var> is not part of a number; fail.</p>
       </li><li data-md="">
        <p>If <var>position</var> is past the end of <var>input</var>, then fail.</p>
       </li><li data-md="">
        <p>Set <var>next character</var> to the character in <var>input</var> pointed to by <var>position</var>, and this time advance <var>position</var> to the next character.
  (If <var>next character</var> was a U+002E FULL STOP character (.) before, it will still
  be that character this time.)</p>
       </li><li data-md="">
        <p>If <var>next character</var> is a U+002E FULL STOP character (.), then run these
  substeps:</p>
        <ol>
         <li data-md="">
          <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-27">Collect a sequence of characters</a> that are <a data-link-type="dfn" href="infrastructure.html#ascii-digits" id="ref-for-ascii-digits-60">ASCII digits</a>. Let <var>s</var> be the resulting sequence.</p>
         </li><li data-md="">
          <p>If <var>s</var> is the empty string, then fail.</p>
         </li><li data-md="">
          <p>Let <var>length</var> be the number of characters in <var>s</var>.</p>
         </li><li data-md="">
          <p>Let <var>fraction</var> be the result of interpreting <var>s</var> as a base-ten
  integer, and then dividing that number by 10<sup><var>length</var></sup>.</p>
         </li><li data-md="">
          <p>Increment <var>N</var> by <var>fraction</var>.</p>
         </li><li data-md="">
          <p><a data-link-type="dfn" href="infrastructure.html#skip-whitespace" id="ref-for-skip-whitespace-8">Skip whitespace</a>.</p>
         </li><li data-md="">
          <p>If <var>position</var> is past the end of <var>input</var>, then fail.</p>
         </li><li data-md="">
          <p>Set <var>next character</var> to the character in <var>input</var> pointed to by <var>position</var>, and advance <var>position</var> to the next character.</p>
         </li><li data-md="">
          <p>If <var>next character</var> is neither a U+0053 LATIN CAPITAL LETTER S character nor
  a U+0073 LATIN SMALL LETTER S character, then fail.</p>
         </li><li data-md="">
          <p>Set <var>units</var> to <i>seconds</i>.</p>
        </li></ol>
        <p>Otherwise, run these substeps:</p>
        <ol>
         <li data-md="">
          <p>If <var>next character</var> is a <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-15">space character</a>, then <a data-link-type="dfn" href="infrastructure.html#skip-whitespace" id="ref-for-skip-whitespace-9">skip whitespace</a>, set <var>next character</var> to the character in <var>input</var> pointed to by <var>position</var>, and advance <var>position</var> to the next character.</p>
         </li><li data-md="">
          <p>If <var>next character</var> is a U+0059 LATIN CAPITAL LETTER Y character, or a
  U+0079 LATIN SMALL LETTER Y character, set <var>units</var> to <i>years</i> and set <var>M-disambiguator</var> to <i>months</i>.</p>
          <p>If <var>next character</var> is a U+004D LATIN CAPITAL LETTER M character or a
  U+006D LATIN SMALL LETTER M character, and <var>M-disambiguator</var> is <i>months</i>, then set <var>units</var> to <i>months</i>.</p>
          <p>If <var>next character</var> is a U+0057 LATIN CAPITAL LETTER W character or a
  U+0077 LATIN SMALL LETTER W character, set <var>units</var> to <i>weeks</i> and set <var>M-disambiguator</var> to <i>minutes</i>.</p>
          <p>If <var>next character</var> is a U+0044 LATIN CAPITAL LETTER D character or a
  U+0064 LATIN SMALL LETTER D character, set <var>units</var> to <i>days</i> and set <var>M-disambiguator</var> to <i>minutes</i>.</p>
          <p>If <var>next character</var> is a U+0048 LATIN CAPITAL LETTER H character or a
  U+0068 LATIN SMALL LETTER H character, set <var>units</var> to <i>hours</i> and set <var>M-disambiguator</var> to <i>minutes</i>.</p>
          <p>If <var>next character</var> is a U+004D LATIN CAPITAL LETTER M character or a
  U+006D LATIN SMALL LETTER M character, and <var>M-disambiguator</var> is <i>minutes</i>, then set <var>units</var> to <i>minutes</i>.</p>
          <p>If <var>next character</var> is a U+0053 LATIN CAPITAL LETTER S character or a
  U+0073 LATIN SMALL LETTER S character, set <var>units</var> to <i>seconds</i> and
  set <var>M-disambiguator</var> to <i>minutes</i>.</p>
          <p>Otherwise if <var>next character</var> is none of the above characters, then fail.</p>
        </li></ol>
       </li><li data-md="">
        <p>Increment <var>component count</var>.</p>
       </li><li data-md="">
        <p>Let <var>multiplier</var> be 1.</p>
       </li><li data-md="">
        <p>If <var>units</var> is <i>years</i>, multiply <var>multiplier</var> by 12 and set <var>units</var> to <i>months</i>.</p>
       </li><li data-md="">
        <p>If <var>units</var> is <i>months</i>, add the product of <var>N</var> and <var>multiplier</var> to <var>months</var>.</p>
        <p>Otherwise, run these substeps:</p>
        <ol>
         <li data-md="">
          <p>If <var>units</var> is <i>weeks</i>, multiply <var>multiplier</var> by 7 and set <var>units</var> to <i>days</i>.</p>
         </li><li data-md="">
          <p>If <var>units</var> is <i>days</i>, multiply <var>multiplier</var> by 24 and set <var>units</var> to <i>hours</i>.</p>
         </li><li data-md="">
          <p>If <var>units</var> is <i>hours</i>, multiply <var>multiplier</var> by 60 and set <var>units</var> to <i>minutes</i>.</p>
         </li><li data-md="">
          <p>If <var>units</var> is <i>minutes</i>, multiply <var>multiplier</var> by 60 and set <var>units</var> to <i>seconds</i>.</p>
         </li><li data-md="">
          <p>Forcibly, <var>units</var> is now <i>seconds</i>. Add the product of <var>N</var> and <var>multiplier</var> to <var>seconds</var>.</p>
        </li></ol>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="infrastructure.html#skip-whitespace" id="ref-for-skip-whitespace-10">Skip whitespace</a>.</p>
      </li></ol>
     </li><li data-md="">
      <p>If <var>component count</var> is zero, fail.</p>
     </li><li data-md="">
      <p>If <var>months</var> is not zero, fail.</p>
     </li><li data-md="">
      <p>Return the <a data-link-type="dfn" href="infrastructure.html#duration" id="ref-for-duration-4">duration</a> consisting of <var>seconds</var> seconds.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.4.5.10" id="vaguer-moments-in-time"><span class="secno">2.4.5.10. </span><span class="content">Vaguer moments in time</span><a class="self-link" href="infrastructure.html#vaguer-moments-in-time"></a></h5>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-date-string-with-optional-time">valid date string with optional time</dfn> if it is also one of the following:</p>
    <ul>
     <li data-md="">
      <p>A <a data-link-type="dfn" href="infrastructure.html#valid-date-string" id="ref-for-valid-date-string-5">valid date string</a></p>
     </li><li data-md="">
      <p>A <a data-link-type="dfn" href="infrastructure.html#valid-global-date-and-time-string" id="ref-for-valid-global-date-and-time-string-2">valid global date and time string</a></p>
    </li></ul>
    <hr>
    <p>The rules to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="parse-a-date-or-time-string">parse a date or time string</dfn> are as follows. The algorithm will return
  either a <a data-link-type="dfn" href="infrastructure.html#dates-date" id="ref-for-dates-date-1">date</a>, a <a data-link-type="dfn" href="infrastructure.html#time" id="ref-for-time-1">time</a>, a <a data-link-type="dfn" href="infrastructure.html#global-date-and-time" id="ref-for-global-date-and-time-2">global date and time</a>, or nothing. If at any point
  the algorithm says that it "fails", this means that it is aborted at that point and returns
  nothing.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start
  of the string.</p>
     </li><li data-md="">
      <p>Set <var>start position</var> to the same position as <var>position</var>.</p>
     </li><li data-md="">
      <p>Set the <var>date present</var> and <var>time present</var> flags to true.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#parse-a-date-component" id="ref-for-parse-a-date-component-4">Parse a date component</a> to obtain <var>year</var>, <var>month</var>, and <var>day</var>. If this fails, then set the <var>date present</var> flag to false.</p>
     </li><li data-md="">
      <p>If <var>date present</var> is true, and <var>position</var> is not beyond the end of <var>input</var>, and the character at <var>position</var> is either a U+0054 LATIN CAPITAL
  LETTER T character (T) or a U+0020 SPACE character, then advance <var>position</var> to the
  next character in <var>input</var>.</p>
      <p>Otherwise, if <var>date present</var> is true, and either <var>position</var> is beyond the
  end of <var>input</var> or the character at <var>position</var> is neither a U+0054 LATIN
  CAPITAL LETTER T character (T) nor a U+0020 SPACE character, then set <var>time present</var> to false.</p>
      <p>Otherwise, if <var>date present</var> is false, set <var>position</var> back to the same
  position as <var>start position</var>.</p>
     </li><li data-md="">
      <p>If the <var>time present</var> flag is true, then <a data-link-type="dfn" href="infrastructure.html#parse-a-time-component" id="ref-for-parse-a-time-component-4">parse a time component</a> to obtain <var>hour</var>, <var>minute</var>, and <var>second</var>. If this returns nothing, then
  fail.</p>
     </li><li data-md="">
      <p>If the <var>date present</var> and <var>time present</var> flags are both true, but <var>position</var> is beyond the end of <var>input</var>, then fail.</p>
     </li><li data-md="">
      <p>If the <var>date present</var> and <var>time present</var> flags are both true, <a data-link-type="dfn" href="infrastructure.html#parse-a-time-zone-offset-component" id="ref-for-parse-a-time-zone-offset-component-3">parse a time-zone offset component</a> to obtain <var>timezone<sub>hours</sub></var> and <var>timezone<sub>minutes</sub></var>. If this returns nothing, then fail.</p>
     </li><li data-md="">
      <p>If <var>position</var> is <em>not</em> beyond the end of <var>input</var>, then fail.</p>
     </li><li data-md="">
      <p>If the <var>date present</var> flag is true and the <var>time present</var> flag is false,
  then let <var>date</var> be the date with year <var>year</var>, month <var>month</var>, and
  day <var>day</var>, and return <var>date</var>.</p>
      <p>Otherwise, if the <var>time present</var> flag is true and the <var>date present</var> flag
  is false, then let <var>time</var> be the time with hour <var>hour</var>, minute <var>minute</var>, and second <var>second</var>, and return <var>time</var>.</p>
      <p>Otherwise, let <var>time</var> be the moment in time at year <var>year</var>, month <var>month</var>, day <var>day</var>, hours <var>hour</var>, minute <var>minute</var>,
  second <var>second</var>, subtracting <var>timezone<sub>hours</sub></var> hours and <var>timezone<sub>minutes</sub></var> minutes, that moment in time being a moment in the UTC
  time zone; let <var>timezone</var> be <var>timezone<sub>hours</sub></var> hours and <var>timezone<sub>minutes</sub></var> minutes from UTC; and return <var>time</var> and <var>timezone</var>.</p>
    </li></ol>
    <h4 class="heading settled" data-level="2.4.6" id="colors"><span class="secno">2.4.6. </span><span class="content">Colors</span><a class="self-link" href="infrastructure.html#colors"></a></h4>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="simple-color">simple color</dfn> consists of three 8-bit numbers in the range 0..255, representing the
  red, green, and blue components of the color respectively, in the sRGB color space. <a data-link-type="biblio" href="references.html#biblio-srgb">[SRGB]</a></p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-simple-color">valid simple color</dfn> if it is exactly seven characters long, and the first
  character is a U+0023 NUMBER SIGN character (#), and the remaining six characters are all <a data-link-type="dfn" href="infrastructure.html#ascii-hex-digits" id="ref-for-ascii-hex-digits-1">ASCII hex digits</a>, with the first two digits representing the red component, the middle two
  digits representing the green component, and the last two digits representing the blue component,
  in hexadecimal.</p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-lowercase-simple-color">valid lowercase simple color</dfn> if it is a <a data-link-type="dfn" href="infrastructure.html#valid-simple-color" id="ref-for-valid-simple-color-1">valid simple color</a> and
  doesn’t use any characters in the range U+0041 LATIN CAPITAL LETTER A to U+0046 LATIN CAPITAL
  LETTER F.</p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="rules-for-parsing-simple-color-values">rules for parsing simple color values</dfn> are as given in the following algorithm.
  When invoked, the steps must be followed in the order given, aborting at the first step that
  returns a value. This algorithm will return either a <a data-link-type="dfn" href="infrastructure.html#simple-color" id="ref-for-simple-color-1">simple color</a> or an error.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>If <var>input</var> is not exactly seven characters long, then return an error.</p>
     </li><li data-md="">
      <p>If the first character in <var>input</var> is not a U+0023 NUMBER SIGN character (#), then
  return an error.</p>
     </li><li data-md="">
      <p>If the last six characters of <var>input</var> are not all <a data-link-type="dfn" href="infrastructure.html#ascii-hex-digits" id="ref-for-ascii-hex-digits-2">ASCII hex digits</a>, then
  return an error.</p>
     </li><li data-md="">
      <p>Let <var>result</var> be a <a data-link-type="dfn" href="infrastructure.html#simple-color" id="ref-for-simple-color-2">simple color</a>.</p>
     </li><li data-md="">
      <p>Interpret the second and third characters as a hexadecimal number and let the result be the
  red component of <var>result</var>.</p>
     </li><li data-md="">
      <p>Interpret the fourth and fifth characters as a hexadecimal number and let the result be the
  green component of <var>result</var>.</p>
     </li><li data-md="">
      <p>Interpret the sixth and seventh characters as a hexadecimal number and let the result be the
  blue component of <var>result</var>.</p>
     </li><li data-md="">
      <p>Return <var>result</var>.</p>
    </li></ol>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="rules-for-serializing-simple-color-values">rules for serializing simple color values</dfn> given a <a data-link-type="dfn" href="infrastructure.html#simple-color" id="ref-for-simple-color-3">simple color</a> are as
  given in the following algorithm:</p>
    <ol>
     <li data-md="">
      <p>Let <var>result</var> be a string consisting of a single U+0023 NUMBER SIGN character (#).</p>
     </li><li data-md="">
      <p>Convert the red, green, and blue components in turn to two-digit hexadecimal numbers using <a data-link-type="dfn" href="infrastructure.html#lowercase-ascii-hex-digits" id="ref-for-lowercase-ascii-hex-digits-1">lowercase ASCII hex digits</a>, zero-padding if necessary, and append these numbers to <var>result</var>, in the order red, green, blue.</p>
     </li><li data-md="">
      <p>Return <var>result</var>, which will be a <a data-link-type="dfn" href="infrastructure.html#valid-lowercase-simple-color" id="ref-for-valid-lowercase-simple-color-1">valid lowercase simple color</a>.</p>
    </li></ol>
    <hr>
    <p>Some obsolete legacy attributes parse colors in a more complicated manner, using the <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="rules for parsing a legacy color value" data-noexport="" id="rules-for-parsing-a-legacy-color-value">rules
  for parsing a legacy color value</dfn>, which are given in the following algorithm. When
  invoked, the steps must be followed in the order given, aborting at the first step that returns
  a value. This algorithm will return either a <a data-link-type="dfn" href="infrastructure.html#simple-color" id="ref-for-simple-color-4">simple color</a> or an error.</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>If <var>input</var> is the empty string, then return an error.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#strip-leading-and-trailing-whitespace" id="ref-for-strip-leading-and-trailing-whitespace-3">Strip leading and trailing whitespace</a> from <var>input</var>.</p>
     </li><li data-md="">
      <p>If <var>input</var> is an <a data-link-type="dfn" href="infrastructure.html#ascii-case-insensitive" id="ref-for-ascii-case-insensitive-4">ASCII case-insensitive</a> match for the string
  "<code>transparent</code>", then return an error.</p>
     </li><li data-md="">
      <p>If <var>input</var> is an <a data-link-type="dfn" href="infrastructure.html#ascii-case-insensitive" id="ref-for-ascii-case-insensitive-5">ASCII case-insensitive</a> match for one of the <a data-link-type="dfn" href="infrastructure.html#named-color" id="ref-for-named-color-1">named colors</a>, then return the <a data-link-type="dfn" href="infrastructure.html#simple-color" id="ref-for-simple-color-5">simple color</a> corresponding to that keyword. <a data-link-type="biblio" href="references.html#biblio-css3color">[CSS3COLOR]</a></p>
      <p class="note" role="note"><a data-link-type="dfn" href="https://www.w3.org/TR/CSS21/ui.html#system-colors">CSS2 System Colors</a> are not recognized.</p>
     </li><li data-md="">
      <p>If <var>input</var> is four characters long, and the first character in <var>input</var> is a
  U+0023 NUMBER SIGN character (#), and the last three characters of <var>input</var> are all <a data-link-type="dfn" href="infrastructure.html#ascii-hex-digits" id="ref-for-ascii-hex-digits-3">ASCII hex digits</a>, then run these substeps:</p>
      <ol>
       <li data-md="">
        <p>Let <var>result</var> be a <a data-link-type="dfn" href="infrastructure.html#simple-color" id="ref-for-simple-color-6">simple color</a>.</p>
       </li><li data-md="">
        <p>Interpret the second character of <var>input</var> as a hexadecimal digit; let the red
  component of <var>result</var> be the resulting number multiplied by 17.</p>
       </li><li data-md="">
        <p>Interpret the third character of <var>input</var> as a hexadecimal digit; let the green
  component of <var>result</var> be the resulting number multiplied by 17.</p>
       </li><li data-md="">
        <p>Interpret the fourth character of <var>input</var> as a hexadecimal digit; let the blue
  component of <var>result</var> be the resulting number multiplied by 17.</p>
       </li><li data-md="">
        <p>Return <var>result</var>.</p>
      </li></ol>
     </li><li data-md="">
      <p>Replace any characters in <var>input</var> that have a Unicode code point greater than U+FFFF
  (i.e., any characters that are not in the basic multilingual plane) with the two-character
  string "<code>00</code>".</p>
     </li><li data-md="">
      <p>If <var>input</var> is longer than 128 characters, truncate <var>input</var>, leaving only
  the first 128 characters.</p>
     </li><li data-md="">
      <p>If the first character in <var>input</var> is a U+0023 NUMBER SIGN character (#), remove it.</p>
     </li><li data-md="">
      <p>Replace any character in <var>input</var> that is not an <a data-link-type="dfn" href="infrastructure.html#ascii-hex-digits" id="ref-for-ascii-hex-digits-4">ASCII hex digit</a> with the
  character U+0030 DIGIT ZERO (0).</p>
     </li><li data-md="">
      <p>While <var>input</var>’s length is zero or not a multiple of three, append a U+0030 DIGIT
  ZERO (0) character to <var>input</var>.</p>
     </li><li data-md="">
      <p>Split <var>input</var> into three strings of equal length, to obtain three components. Let <var>length</var> be the length of those components (one third the length of <var>input</var>).</p>
     </li><li data-md="">
      <p>If <var>length</var> is greater than 8, then remove the leading <var>length</var>-8
  characters in each component, and let <var>length</var> be 8.</p>
     </li><li data-md="">
      <p>While <var>length</var> is greater than two and the first character in each component is a
  U+0030 DIGIT ZERO (0) character, remove that character and reduce <var>length</var> by one.</p>
     </li><li data-md="">
      <p>If <var>length</var> is <em>still</em> greater than two, truncate each component, leaving
  only the first two characters in each.</p>
     </li><li data-md="">
      <p>Let <var>result</var> be a <a data-link-type="dfn" href="infrastructure.html#simple-color" id="ref-for-simple-color-7">simple color</a>.</p>
     </li><li data-md="">
      <p>Interpret the first component as a hexadecimal number; let the red component of <var>result</var> be the resulting number.</p>
     </li><li data-md="">
      <p>Interpret the second component as a hexadecimal number; let the green component of <var>result</var> be the resulting number.</p>
     </li><li data-md="">
      <p>Interpret the third component as a hexadecimal number; let the blue component of <var>result</var> be the resulting number.</p>
     </li><li data-md="">
      <p>Return <var>result</var>.</p>
    </li></ol>
    <h4 class="heading settled" data-level="2.4.7" id="space-separated-tokens"><span class="secno">2.4.7. </span><span class="content">Space-separated tokens</span><a class="self-link" href="infrastructure.html#space-separated-tokens"></a></h4>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="set-of-space-separated-tokens">set of space-separated tokens</dfn> is a string containing zero or more words (known as
  tokens) separated by one or more <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-16">space characters</a>, where words consist of any string of one
  or more characters, none of which are <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-17">space characters</a>.</p>
    <p>A string containing a <a data-link-type="dfn" href="infrastructure.html#set-of-space-separated-tokens" id="ref-for-set-of-space-separated-tokens-1">set of space-separated tokens</a> may have leading or trailing <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-18">space characters</a>.</p>
    <p>An <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="unordered-set-of-unique-space-separated-tokens">unordered set of unique space-separated tokens</dfn> is a <a data-link-type="dfn" href="infrastructure.html#set-of-space-separated-tokens" id="ref-for-set-of-space-separated-tokens-2">set of space-separated tokens</a> where none of the tokens are duplicated.</p>
    <p>An <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="ordered-set-of-unique-space-separated-tokens">ordered set of unique space-separated tokens</dfn> is a <a data-link-type="dfn" href="infrastructure.html#set-of-space-separated-tokens" id="ref-for-set-of-space-separated-tokens-3">set of space-separated tokens</a> where none of the tokens are duplicated but where the order
  of the tokens is meaningful.</p>
    <p><a data-link-type="dfn" href="infrastructure.html#set-of-space-separated-tokens" id="ref-for-set-of-space-separated-tokens-4">Sets of space-separated tokens</a> sometimes have a defined set of allowed values. When a set
  of allowed values is defined, the tokens must all be from that list of allowed values; other
  values are non-conforming. If no such set of allowed values is provided, then all values are
  conforming.</p>
    <p class="note" role="note"> How tokens in a <a data-link-type="dfn" href="infrastructure.html#set-of-space-separated-tokens" id="ref-for-set-of-space-separated-tokens-5">set of space-separated tokens</a> are to be compared (e.g., case-sensitively
    or not) is defined on a per-set basis. </p>
    <p>When a user agent has to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="split-a-string-on-spaces">split a string on spaces</dfn>, it must use the following
  algorithm:</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start
  of the string.</p>
     </li><li data-md="">
      <p>Let <var>tokens</var> be an ordered list of tokens, initially empty.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#skip-whitespace" id="ref-for-skip-whitespace-11">Skip whitespace</a></p>
     </li><li data-md="">
      <p>While <var>position</var> is not past the end of <var>input</var>:</p>
      <ol>
       <li data-md="">
        <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-28">Collect a sequence of characters</a> that are not <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-19">space characters</a>.</p>
       </li><li data-md="">
        <p>Append the string collected in the previous step to <var>tokens</var>.</p>
       </li><li data-md="">
        <p><a data-link-type="dfn" href="infrastructure.html#skip-whitespace" id="ref-for-skip-whitespace-12">Skip whitespace</a></p>
      </li></ol>
     </li><li data-md="">
      <p>Return <var>tokens</var>.</p>
    </li></ol>
    <h4 class="heading settled" data-level="2.4.8" id="comma-separated-tokens"><span class="secno">2.4.8. </span><span class="content">Comma-separated tokens</span><a class="self-link" href="infrastructure.html#comma-separated-tokens"></a></h4>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="set-of-comma-separated-tokens">set of comma-separated tokens</dfn> is a string containing zero or more tokens each
  separated from the next by a single U+002C COMMA character (,), where tokens consist of any string
  of zero or more characters, neither beginning nor ending with <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-20">space characters</a>, nor
  containing any U+002C COMMA characters (,), and optionally surrounded by <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-21">space characters</a>.</p>
    <p class="example" id="example-65e3af79"><a class="self-link" href="infrastructure.html#example-65e3af79"></a> For instance, the string "<code>&nbsp;a&nbsp;,b,d&nbsp;d&nbsp;</code>" consists of four tokens:
    "a", "b", the empty string, and "d&nbsp;d". Leading and trailing whitespace around each token
    doesn’t count as part of the token, and the empty string can be a token. </p>
    <p><a data-link-type="dfn" href="infrastructure.html#set-of-comma-separated-tokens" id="ref-for-set-of-comma-separated-tokens-1">Sets of comma-separated tokens</a> sometimes have further restrictions on what consists a valid
  token. When such restrictions are defined, the tokens must all fit within those restrictions;
  other values are non-conforming. If no such restrictions are specified, then all values are
  conforming.</p>
    <p>When a user agent has to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="split-a-string-on-commas">split a string on commas</dfn>, it must use the following algorithm:</p>
    <ol>
     <li data-md="">
      <p>Let <var>input</var> be the string being parsed.</p>
     </li><li data-md="">
      <p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start
  of the string.</p>
     </li><li data-md="">
      <p>Let <var>tokens</var> be an ordered list of tokens, initially empty.</p>
     </li><li data-md="">
      <p><i>Token</i>: If <var>position</var> is past the end of <var>input</var>, jump to the last
  step.</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#collect-a-sequence-of-characters" id="ref-for-collect-a-sequence-of-characters-29">Collect a sequence of characters</a> that are not U+002C COMMA characters (,). Let <var>s</var> be the resulting sequence (which might be the empty string).</p>
     </li><li data-md="">
      <p><a data-link-type="dfn" href="infrastructure.html#strip-leading-and-trailing-whitespace" id="ref-for-strip-leading-and-trailing-whitespace-4">Strip leading and trailing whitespace</a> from <var>s</var>.</p>
     </li><li data-md="">
      <p>Append <var>s</var> to <var>tokens</var>.</p>
     </li><li data-md="">
      <p>If <var>position</var> is not past the end of <var>input</var>, then the character at <var>position</var> is a U+002C COMMA character (,); advance <var>position</var> past that
  character.</p>
     </li><li data-md="">
      <p>Jump back to the step labeled <i>token</i>.</p>
     </li><li data-md="">
      <p>Return <var>tokens</var>.</p>
    </li></ol>
    <h4 class="heading settled" data-level="2.4.9" id="syntax-references"><span class="secno">2.4.9. </span><span class="content">References</span><a class="self-link" href="infrastructure.html#syntax-references"></a></h4>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-hash-name-reference">valid hash-name reference</dfn> to an element of type <var>type</var> is a
  string consisting of a U+0023 NUMBER SIGN character (#) followed by a string which exactly matches
  the value of the <code>name</code> attribute of an element with type <var>type</var> in
  the document.</p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="rules-for-parsing-a-hash-name-reference">rules for parsing a hash-name reference</dfn> to an element of type <var>type</var>,
  given a context node <var>scope</var>, are as follows:</p>
    <ol>
     <li data-md="">
      <p>If the string being parsed does not contain a U+0023 NUMBER SIGN character, or if the first
  such character in the string is the last character in the string, then return null and abort
  these steps.</p>
     </li><li data-md="">
      <p>Let <var>s</var> be the string from the character immediately after the first U+0023 NUMBER
  SIGN character in the string being parsed up to the end of that string.</p>
     </li><li data-md="">
      <p>Return the first element of type <var>type</var> in <a data-link-type="dfn" href="infrastructure.html#tree-order" id="ref-for-tree-order-2">tree order</a> in the subtree rooted
  at <var>scope</var> that has an <code>id</code> attribute whose value is a <a data-link-type="dfn" href="infrastructure.html#case-sensitive" id="ref-for-case-sensitive-2">case-sensitive</a> match for <var>s</var> or a <code>name</code> attribute whose value is
  a <a data-link-type="dfn" href="infrastructure.html#compatibility-caseless" id="ref-for-compatibility-caseless-1">compatibility caseless</a> match for <var>s</var>.</p>
    </li></ol>
    <h4 class="heading settled" data-level="2.4.10" id="mq"><span class="secno">2.4.10. </span><span class="content">Media queries</span><a class="self-link" href="infrastructure.html#mq"></a></h4>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-media-query-list">valid media query list</dfn> if it matches the <code>&lt;media-query-list&gt;</code> production of the Media Queries specification. <a data-link-type="biblio" href="references.html#biblio-mediaq">[MEDIAQ]</a></p>
    <p>A string <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="match the environment|matches the environment" data-noexport="" id="match-the-environment">matches the environment</dfn> of the user if it is the empty string, a string
  consisting of only <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-22">space characters</a>, or is a media query list that matches the user’s
  environment according to the definitions given in the Media Queries specification. <a data-link-type="biblio" href="references.html#biblio-mediaq">[MEDIAQ]</a></p>
    <h3 class="heading settled" data-level="2.5" id="infrastructure-urls"><span class="secno">2.5. </span><span class="content">URLs</span><a class="self-link" href="infrastructure.html#infrastructure-urls"></a></h3>
    <h4 class="heading settled" data-level="2.5.1" id="urls-terminology"><span class="secno">2.5.1. </span><span class="content">Terminology</span><a class="self-link" href="infrastructure.html#urls-terminology"></a></h4>
    <p>A <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a> is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-url">valid URL</dfn> if it conforms to the authoring conformance
  requirements in the WHATWG URL standard. <a data-link-type="biblio" href="references.html#biblio-url">[URL]</a></p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-non-empty-url">valid non-empty URL</dfn> if it is a <a data-link-type="dfn" href="infrastructure.html#valid-url" id="ref-for-valid-url-1">valid URL</a> but it is not
  the empty string.</p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-url-potentially-surrounded-by-spaces">valid URL potentially surrounded by spaces</dfn> if, after <a data-link-type="dfn" href="infrastructure.html#strip-leading-and-trailing-whitespace" id="ref-for-strip-leading-and-trailing-whitespace-5">stripping leading and trailing whitespace</a> from it, it is a <a data-link-type="dfn" href="infrastructure.html#valid-url" id="ref-for-valid-url-2">valid URL</a>.</p>
    <p>A string is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty URL potentially surrounded by spaces</dfn> if, after <a data-link-type="dfn" href="infrastructure.html#strip-leading-and-trailing-whitespace" id="ref-for-strip-leading-and-trailing-whitespace-6">stripping leading and trailing whitespace</a> from it, it is a <a data-link-type="dfn" href="infrastructure.html#valid-non-empty-url" id="ref-for-valid-non-empty-url-1">valid non-empty URL</a>.</p>
    <p>This specification defines the URL <dfn class="dfn-paneled" data-dfn-type="scheme" data-export="" id="schemedef-aboutlegacy-compat"><code>about:legacy-compat</code></dfn> as a reserved,
  though unresolvable, <a data-link-type="scheme" href="infrastructure.html#schemedef-about" id="ref-for-schemedef-about-3"><code>about:</code></a> URL, for use in <a data-link-type="dfn" href="syntax.html#doctype" id="ref-for-doctype-1">DOCTYPE</a>s in <a data-link-type="dfn" href="infrastructure.html#html-document" id="ref-for-html-document-4">HTML documents</a> when needed for compatibility with XML tools. <a data-link-type="biblio" href="references.html#biblio-rfc6694">[RFC6694]</a></p>
    <p>This specification defines the URL <dfn class="dfn-paneled" data-dfn-type="scheme" data-export="" id="schemedef-aboutsrcdoc"><code>about:srcdoc</code></dfn> as a reserved, though
  unresolvable, <a data-link-type="scheme" href="infrastructure.html#schemedef-about" id="ref-for-schemedef-about-4"><code>about:</code></a> URL, that is used as <a data-link-type="dfn" href="dom.html#the-document-address" id="ref-for-the-document-address-1">the document’s address</a> of <a data-link-type="dfn" href="semantics-embedded-content.html#iframe-iframe-srcdoc-document" id="ref-for-iframe-iframe-srcdoc-document-1"><code>iframe</code> <code>srcdoc</code> documents</a>. <a data-link-type="biblio" href="references.html#biblio-rfc6694">[RFC6694]</a></p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="fallback-base-url">fallback base URL</dfn> of a <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> object is the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#syntax-url-absolute">absolute URL</a> obtained by running these substeps:</p>
    <ol>
     <li data-md="">
      <p>If <var>document</var> is <a data-link-type="dfn" href="semantics-embedded-content.html#iframe-iframe-srcdoc-document" id="ref-for-iframe-iframe-srcdoc-document-2">an <code>iframe</code> <code>srcdoc</code> document</a>,
  then return the <a data-link-type="dfn" href="infrastructure.html#document-base-url" id="ref-for-document-base-url-1">document base URL</a> of the <var>Document</var>’s <a data-link-type="dfn" href="browsers.html#browsing-context" id="ref-for-browsing-context-5">browsing context</a>’s <a data-link-type="dfn" href="browsers.html#browsing-context-container" id="ref-for-browsing-context-container-1">browsing context container</a>’s <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-document">node document</a>.</p>
     </li><li data-md="">
      <p>If <var>document</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a> is <code>about:blank</code>, and the <var>Document</var>’s <a data-link-type="dfn" href="browsers.html#browsing-context" id="ref-for-browsing-context-6">browsing context</a> has a <a data-link-type="dfn" href="browsers.html#creator-browsing-context" id="ref-for-creator-browsing-context-1">creator browsing context</a>, then
  return the <a data-link-type="dfn" href="browsers.html#creator-base-url" id="ref-for-creator-base-url-1">creator base URL</a>.</p>
     </li><li data-md="">
      <p>Return <var>document</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a>.</p>
    </li></ol>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="document-base-url">document base URL</dfn> of a <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> object is the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#syntax-url-absolute">absolute URL</a> obtained by running these substeps:</p>
    <ol>
     <li data-md="">
      <p>If there is no <code><a data-link-type="element" href="document-metadata.html#elementdef-base" id="ref-for-elementdef-base-2">base</a></code> element that has an <code><a data-link-type="element-sub" href="document-metadata.html#element-attrdef-base-href" id="ref-for-element-attrdef-base-href-1">href</a></code> attribute in the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code>, then the <a data-link-type="dfn" href="infrastructure.html#document-base-url" id="ref-for-document-base-url-2">document base URL</a> is the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code>'s <a data-link-type="dfn" href="infrastructure.html#fallback-base-url" id="ref-for-fallback-base-url-1">fallback base URL</a>; abort these steps.</p>
     </li><li data-md="">
      <p>Otherwise, the <a data-link-type="dfn" href="infrastructure.html#document-base-url" id="ref-for-document-base-url-3">document base URL</a> is the <a data-link-type="dfn" href="document-metadata.html#frozen-base-url" id="ref-for-frozen-base-url-1">frozen base URL</a> of the first <code><a data-link-type="element" href="document-metadata.html#elementdef-base" id="ref-for-elementdef-base-3">base</a></code> element in the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> that has an <code><a data-link-type="element-sub" href="document-metadata.html#element-attrdef-base-href" id="ref-for-element-attrdef-base-href-2">href</a></code> attribute, in <a data-link-type="dfn" href="infrastructure.html#tree-order" id="ref-for-tree-order-3">tree order</a>.</p>
    </li></ol>
    <h4 class="heading settled" data-level="2.5.2" id="parsing-urls"><span class="secno">2.5.2. </span><span class="content">Parsing URLs</span><a class="self-link" href="infrastructure.html#parsing-urls"></a></h4>
    <p>Parsing a URL is the process of taking a URL string and obtaining the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url">URL record</a> that it
  implies. While this process is defined in the WHATWG URL standard, this specification defines a
  wrapper for convenience. <a data-link-type="biblio" href="references.html#biblio-url">[URL]</a></p>
    <p class="note" role="note">This wrapper is only useful when the character encoding for the URL parser has to
  match that of the document or environment settings object for legacy reasons. When that is not the
  case the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser">URL parser</a> can be used directly.</p>
    <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="reparsed|parse a URL|parse|parsing|parsing of relative urls|parsing relative urls" data-noexport="" id="reparsed">parse a URL</dfn> <var>url</var>, relative to either a <var>document</var> or <var>environment settings object</var>, the user agent must use the following steps. Parsing a URL
  either results in failure or a <a data-link-type="dfn" href="infrastructure.html#resulting-url-string" id="ref-for-resulting-url-string-1">resulting URL string</a> and <a data-link-type="dfn" href="infrastructure.html#resulting-url-record" id="ref-for-resulting-url-record-1">resulting URL record</a>.</p>
    <ol>
     <li data-md="">
      <p>Let <var>encoding</var> be <var>document</var>’s <a data-link-type="dfn" href="infrastructure.html#character-encoding" id="ref-for-character-encoding-3">character encoding</a>, if <var>document</var> was given, and <var>environment settings object</var>’s <a data-link-type="dfn" href="webappapis.html#api-url-character-encoding" id="ref-for-api-url-character-encoding-1">API URL character encoding</a> otherwise.</p>
     </li><li data-md="">
      <p>Let <var>baseURL</var> be <var>document</var>’s <a data-link-type="dfn" href="infrastructure.html#document-base-url" id="ref-for-document-base-url-4">base URL</a>, if <var>document</var> was
  given, and <var>environment settings object</var>’s <a data-link-type="dfn" href="webappapis.html#api-base-url" id="ref-for-api-base-url-1">API base URL</a> otherwise.</p>
     </li><li data-md="">
      <p>Let <var>urlRecord</var> be the result of applying the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser">URL parser</a> to <var>url</var>,
  with <var>baseURL</var> and <var>encoding</var>.</p>
     </li><li data-md="">
      <p>If <var>urlRecord</var> is failure, then abort these steps with an error.</p>
     </li><li data-md="">
      <p>Let <var>urlString</var> be the result of applying the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-serializer">URL serializer</a> to <var>urlRecord</var>.</p>
     </li><li data-md="">
      <p>Return <var>urlString</var> as the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="resulting-url-string">resulting URL string</dfn> and <var>urlRecord</var> as
  the <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="resulting URL record|resulting URL records" data-noexport="" id="resulting-url-record">resulting URL record</dfn>.</p>
    </li></ol>
    <h4 class="heading settled" data-level="2.5.3" id="dynamic-changes-to-base-urls"><span class="secno">2.5.3. </span><span class="content">Dynamic changes to base URLs</span><a class="self-link" href="infrastructure.html#dynamic-changes-to-base-urls"></a></h4>
    <p>When a document’s <a data-link-type="dfn" href="infrastructure.html#document-base-url" id="ref-for-document-base-url-5">document base URL</a> changes, all elements in that document are <a data-link-type="dfn" href="infrastructure.html#affected-by-a-base-url-change" id="ref-for-affected-by-a-base-url-change-1">affected by a base URL change</a>.</p>
    <p>The following are <a data-link-type="dfn" href="infrastructure.html#base-url-change-steps" id="ref-for-base-url-change-steps-1">base URL change steps</a>, which run when an element is <a data-link-type="dfn" href="infrastructure.html#affected-by-a-base-url-change" id="ref-for-affected-by-a-base-url-change-2">affected by a base URL change</a> (as defined by the DOM specification):</p>
    <dl class="switch">
     <dt>If the element creates a <a data-link-type="dfn" href="links.html#hyperlink" id="ref-for-hyperlink-2">hyperlink</a>
     </dt><dd>
       If the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a> identified by the hyperlink is being shown to the user, or if any
      data derived from that <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a> is affecting the display, then the <code><a data-link-type="element-sub" href="links.html#element-attrdef-a-href" id="ref-for-element-attrdef-a-href-4">href</a></code> attribute should be <a data-link-type="dfn" href="infrastructure.html#reparsed" id="ref-for-reparsed-2">reparsed</a> relative to the element’s <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-document">node document</a> and the UI
      updated appropriately. 
      <p class="example" id="example-c59a69a9"><a class="self-link" href="infrastructure.html#example-c59a69a9"></a> For example, the CSS <code>:link</code>/<code>:visited</code> pseudo-classes might have
        been affected. </p>
     </dd><dt> If the element is a <code><a data-link-type="element" href="textlevel-semantics.html#elementdef-q" id="ref-for-elementdef-q-1">q</a></code>, <code><a data-link-type="element" href="grouping-content.html#elementdef-blockquote" id="ref-for-elementdef-blockquote-3">blockquote</a></code>, <code><a data-link-type="element" href="edits.html#elementdef-ins" id="ref-for-elementdef-ins-1">ins</a></code>, or <code><a data-link-type="element" href="edits.html#elementdef-del" id="ref-for-elementdef-del-1">del</a></code> element with a <code>cite</code> attribute 
     </dt><dd> If the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a> identified by the <code>cite</code> attribute is being shown to
      the user, or if any data derived from that <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a> is affecting the display, then
      the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a> should be <a data-link-type="dfn" href="infrastructure.html#reparsed" id="ref-for-reparsed-3">reparsed</a> relative to the element’s <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-document">node document</a> and the UI updated appropriately. 
     </dd><dt>Otherwise
     </dt><dd>
       The element is not directly affected. 
      <p class="example" id="example-f40f8618"><a class="self-link" href="infrastructure.html#example-f40f8618"></a> For instance, changing the base URL doesn’t affect the image displayed by <code>img</code> elements, although subsequent accesses of the <code>src</code> IDL attribute from script
        will return a new <a data-link-type="dfn" href="https://url.spec.whatwg.org/#syntax-url-absolute">absolute URL</a> that might no longer correspond to the image being
        shown. </p>
    </dd></dl>
    <h3 class="heading settled" data-level="2.6" id="fetching-resources"><span class="secno">2.6. </span><span class="content">Fetching resources</span><a class="self-link" href="infrastructure.html#fetching-resources"></a></h3>
    <h4 class="heading settled" data-level="2.6.1" id="fetching-resources-terminology"><span class="secno">2.6.1. </span><span class="content">Terminology</span><a class="self-link" href="infrastructure.html#fetching-resources-terminology"></a></h4>
    <p>User agents can implement a variety of transfer protocols, but this specification mostly defines
  behavior in terms of HTTP. <a data-link-type="biblio" href="references.html#biblio-http">[HTTP]</a></p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="or equivalent|HTTP GET method" data-noexport="" id="or-equivalent">HTTP GET method</dfn> is equivalent to the default retrieval action of the protocol.
  For example, RETR in FTP. Such actions are idempotent and safe, in HTTP terms.</p>
    <p>The <dfn data-dfn-type="dfn" data-noexport="" id="http-response-codes">HTTP response codes<a class="self-link" href="infrastructure.html#http-response-codes"></a></dfn> are equivalent to statuses in other protocols that have the
  same basic meanings. For example, a "file not found" error is equivalent to a 404 code, a server
  error is equivalent to a 5xx code, and so on.</p>
    <p>The <dfn data-dfn-type="dfn" data-noexport="" id="http-headers">HTTP headers<a class="self-link" href="infrastructure.html#http-headers"></a></dfn> are equivalent to fields in
  other protocols that have the same basic meaning. For example, the HTTP authentication headers
  are equivalent to the authentication aspects of the FTP protocol.</p>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="referrer-source">referrer source</dfn> is either a <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> or a <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a>.</p>
    <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="creating a potential-cors request|create a potential-CORS request" data-noexport="" id="creating-a-potential-cors-request">create a potential-CORS request</dfn>, given a <var>url</var>, <var>corsAttributeState</var>, and an optional <i>same-origin fallback flag</i>, run these steps:</p>
    <ol>
     <li data-md="">
      <p>Let <var>mode</var> be "<code>no-cors</code>" if <var>corsAttributeState</var> is <a data-link-type="state" href="infrastructure.html#statedef-cors-no-cors" id="ref-for-statedef-cors-no-cors-1">No CORS</a>, and "<code>cors</code>" otherwise.</p>
     </li><li data-md="">
      <p>If <i>same-origin fallback flag</i> is set and <var>mode</var> is "<code>no-cors</code>", set <var>mode</var> to "<code>same-origin</code>".</p>
     </li><li data-md="">
      <p>Let <var>credentialsMode</var> be "<code>include</code>".</p>
     </li><li data-md="">
      <p>If <var>corsAttributeState</var> is <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#anonymous">Anonymous</a>, set <var>credentialsMode</var> to
  "<code>same-origin</code>".</p>
     </li><li data-md="">
      <p>Let <var>request</var> be a new <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request">request</a> whose <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a> is <var>url</var>, <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-destination">destination</a> is "<code>subresource</code>", <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-mode">mode</a> is <var>mode</var>, <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-credentials-mode">credentials mode</a> is <var>credentialsMode</var>, and whose <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-use-url-credentials-flag">use-URL-credentials flag</a> is set.</p>
    </li></ol>
    <h4 class="heading settled" data-level="2.6.2" id="fetching-resources-processing-model"><span class="secno">2.6.2. </span><span class="content">Processing model</span><a class="self-link" href="infrastructure.html#fetching-resources-processing-model"></a></h4>
    <p>When a user agent is to <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch">fetch</a> a resource or <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a>, optionally <strong>from</strong> an origin <i>origin</i>, optionally <strong>using</strong> a specific <a data-link-type="dfn" href="infrastructure.html#referrer-source" id="ref-for-referrer-source-1">referrer source</a> as an <i>override referrer source</i>, and optionally with any of a <i>synchronous flag</i>, a <i>manual redirect flag</i>, a <i>force same-origin flag</i>, and a <i>block cookies flag</i>, the following steps must be run. (When a <em>URL</em> is to be
  fetched, the URL identifies a resource to be obtained.)</p>
    <ol>
     <li data-md="">
      <p>If there is a specific <i>override referrer source</i>, and it is a <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a>, then let <var>referrer</var> be the <i>override referrer source</i>, and jump to the step labeled <i>clean referrer</i>.</p>
     </li><li data-md="">
      <p>Let <var>document</var> be the appropriate <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> as given by the following
  list:</p>
      <dl class="switch">
       <dt>If there is a specific <i>override referrer source</i>
       </dt><dd>The <i>override referrer source</i>.
       </dd><dt>When <a data-link-type="dfn" href="browsers.html#navigated" id="ref-for-navigated-2">navigating</a>
       </dt><dd>The <a data-link-type="dfn" href="browsers.html#active-document" id="ref-for-active-document-1">active document</a> of the <a data-link-type="dfn" href="browsers.html#source-browsing-context" id="ref-for-source-browsing-context-1">source browsing context</a>.
       </dd><dt>When fetching resources for an element
       </dt><dd>The element’s <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code>.
      </dd></dl>
     </li><li data-md="">
      <p>While <var>document</var> is <a data-link-type="dfn" href="semantics-embedded-content.html#iframe-iframe-srcdoc-document" id="ref-for-iframe-iframe-srcdoc-document-3">an <code>iframe</code> <code>srcdoc</code> document</a>, let <var>document</var> be <var>document</var>’s <a data-link-type="dfn" href="browsers.html#browsing-context" id="ref-for-browsing-context-7">browsing context</a>’s <a data-link-type="dfn" href="browsers.html#browsing-context-container" id="ref-for-browsing-context-container-2">browsing context container</a>’s <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> instead.</p>
     </li><li data-md="">
      <p>If the <a data-link-type="dfn" href="browsers.html#concept-cross-origin" id="ref-for-concept-cross-origin-1">origin</a> of <var>Document</var> is not a scheme/host/port tuple, then
  set <var>referrer</var> to the empty string and jump to the step labeled <var>Clean referrer</var>.</p>
     </li><li data-md="">
      <p>Let <var>referrer</var> be <a data-link-type="dfn" href="dom.html#the-document-address" id="ref-for-the-document-address-2">the document’s address</a> of <var>document</var>.</p>
     </li><li data-md="">
      <p><var>Clean referrer</var>: Apply the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser">URL parser</a> to <var>referrer</var> and let <var>parsed referrer</var> be the <a data-link-type="dfn" href="infrastructure.html#resulting-url-record" id="ref-for-resulting-url-record-2">resulting URL record</a>.</p>
     </li><li data-md="">
      <p>Let <var>referrer</var> be the result of applying the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-serializer">URL serializer</a> to <var>parsed referrer</var>, with the <i>exclude fragment flag</i> set.</p>
     </li><li data-md="">
      <p>If <var>referrer</var> is not the empty string, is not a <a data-link-type="scheme" href="infrastructure.html#schemedef-data-url" id="ref-for-schemedef-data-url-3"><code>data:</code> URL</a>, and
  is not the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a> "<code>about:blank</code>", then generate the <i>address of the
  resource from which Request-URIs are obtained</i> as required by HTTP for the <code>Referer</code> (sic) header from <var>referrer</var>. <a data-link-type="biblio" href="references.html#biblio-http">[HTTP]</a></p>
      <p>Otherwise, the <code>Referer</code> (sic) header must be omitted, regardless of its value.</p>
     </li><li data-md="">
      <p>If the algorithm was not invoked with the <i>synchronous flag</i>, perform the remaining
  steps <a data-link-type="dfn" href="infrastructure.html#in-parallel" id="ref-for-in-parallel-2">in parallel</a>.</p>
     </li><li data-md="">
      <p>If the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> with which any <a data-link-type="dfn" href="webappapis.html#tasks" id="ref-for-tasks-1">tasks</a> <a data-link-type="dfn" href="webappapis.html#queue-a-microtask" id="ref-for-queue-a-microtask-1">queued</a> by this algorithm
  would be associated doesn’t have an associated <a data-link-type="dfn" href="browsers.html#browsing-context" id="ref-for-browsing-context-8">browsing context</a>, then abort these
  steps.</p>
     </li><li data-md="">
      <p>This is the <i>main step</i>.</p>
      <p>If the resource is to be obtained from an <a data-link-type="dfn" href="obsolete.html#application-cache-manifest" id="ref-for-application-cache-manifest-1">application cache</a>, then use the data from
  that <a data-link-type="dfn" href="obsolete.html#application-cache-manifest" id="ref-for-application-cache-manifest-2">application cache</a>, as if it had been obtained in the manner appropriate given
  its <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a>.</p>
      <p>If the resource is identified by an <a data-link-type="dfn" href="https://url.spec.whatwg.org/#syntax-url-absolute">absolute URL</a>, and the resource is to be obtained
  using an idempotent action (such as an HTTP GET <a data-link-type="dfn" href="infrastructure.html#or-equivalent" id="ref-for-or-equivalent-1">or equivalent</a>), and it is already
  being downloaded for other reasons (e.g., another invocation of this algorithm), and this
  request would be identical to the previous one (e.g., same <code>Accept</code> and <code>Origin</code> headers), and the user agent is configured such that it is to reuse the
  data from the existing download instead of initiating a new one, then use the results of the
  existing download instead of starting a new one.</p>
      <p>Otherwise, if the resource is identified by an <a data-link-type="dfn" href="https://url.spec.whatwg.org/#syntax-url-absolute">absolute URL</a> with a scheme that does
  not define a mechanism to obtain the resource (e.g., it is a <code>mailto:</code> URL) or
  that the user agent does not support, then act as if the resource was an HTTP 204 No Content
  response with no other metadata.</p>
      <p>Otherwise, if the resource is identified by the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a> <code>about:blank</code>, then the resource is immediately available and consists
  of the empty string, with no metadata.</p>
      <p>Otherwise, at a time convenient to the user and the user agent, download (or otherwise
  obtain) the resource, applying the semantics of the relevant specifications (e.g., performing
  an HTTP GET or POST operation, or reading the file from disk, or expanding <a data-link-type="scheme" href="infrastructure.html#schemedef-data-url" id="ref-for-schemedef-data-url-4"><code>data:</code> URLs</a>, etc).</p>
      <p>For the purposes of the <code>Referer</code> (sic) header, use the <i>address of the resource from which Request-URIs are obtained</i> generated in the earlier
  step.</p>
      <p>For the purposes of the <code>Origin</code> header, if the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch">fetching algorithm</a> was
  explicitly initiated from an <i>origin</i>, then <i>the origin that initiated the HTTP request</i> is <i>origin</i>. Otherwise, this is <i>a request from a "privacy-sensitive" context</i>. <a data-link-type="biblio" href="references.html#biblio-origin">[ORIGIN]</a></p>
     </li><li data-md="">
      <p>If the algorithm was not invoked with the <i>block cookies flag</i>, and there are cookies
  to be set, update the cookies. <a data-link-type="biblio" href="references.html#biblio-cookies">[COOKIES]</a> <a class="fingerprint" href="introduction.html#fingerprinting-vector" id="ref-for-fingerprinting-vector-4"><img alt="(This is a fingerprinting vector.)" height="21" src="images/fingerprint.png" width="15"></a></p>
     </li><li data-md="">
      <p>If the fetched resource is an HTTP redirect <a data-link-type="dfn" href="infrastructure.html#or-equivalent" id="ref-for-or-equivalent-2">or equivalent</a>, then:</p>
      <dl class="switch">
       <dt> If the <i>force same-origin flag</i> is set and the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a> of the target of the
      redirect does not have the <a data-link-type="dfn" href="browsers.html#same-origin" id="ref-for-same-origin-1">same origin</a> as the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a> for which the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch">fetch</a> algorithm was invoked 
       </dt><dd> Abort these steps and return failure from this algorithm, as if the remote host could
      not be contacted. 
       </dd><dt>If the <i>manual redirect flag</i> is set
       </dt><dd> Continue, using the fetched resource (the redirect) as the result of the algorithm. If
      the calling algorithm subsequently requires the user agent to <dfn data-dfn-type="dfn" data-noexport="" id="transparently-follow-the-redirect">transparently follow the redirect<a class="self-link" href="infrastructure.html#transparently-follow-the-redirect"></a></dfn>, then the user agent must resume this
      algorithm from the <i>main step</i>, but using the target of the redirect as the
      resource to fetch, rather than the original resource. 
       </dd><dt>Otherwise
       </dt><dd>
         First, apply any relevant requirements for redirects (such as showing any appropriate
      prompts). Then, redo <i>main step</i>, but using the target of the redirect as the
      resource to fetch, rather than the original resource. For HTTP requests, the new request
      must include the same headers as the original request, except for headers for which
      other requirements are specified (such as the <code>Host</code> header). <a data-link-type="biblio" href="references.html#biblio-http">[HTTP]</a> 
        <p class="note" role="note"> The HTTP specification requires that 301, 302, and 307 redirects, when applied to
        methods other than the safe methods, not be followed without user confirmation. That
        would be an appropriate prompt for the purposes of the requirement in the paragraph
        above. <a data-link-type="biblio" href="references.html#biblio-http">[HTTP]</a> </p>
      </dd></dl>
     </li><li data-md="">
      <p>If the algorithm was not invoked with the <i>synchronous flag</i>: When the resource is
  available, or if there is an error of some description, <a data-link-type="dfn" href="webappapis.html#queuing" id="ref-for-queuing-1">queue a task</a> that uses the
  resource as appropriate. If the resource can be processed incrementally, as, for instance,
  with a progressively interlaced JPEG or an HTML file, additional tasks may be queued to
  process the data as it is downloaded. The <a data-link-type="dfn" href="webappapis.html#task-source" id="ref-for-task-source-1">task source</a> for these <a data-link-type="dfn" href="webappapis.html#tasks" id="ref-for-tasks-2">tasks</a> is the <a data-link-type="dfn" href="webappapis.html#networking-task-source" id="ref-for-networking-task-source-1">networking task source</a>.</p>
      <p>Otherwise, return the resource or error information to the calling algorithm.</p>
    </li></ol>
    <p>If the user agent can determine the actual length of the resource being <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch">fetched</a> for an
  instance of this algorithm, and if that length is finite, then that length is the file’s <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="size">size</dfn>. Otherwise, the subject of the algorithm (that is, the resource being fetched)
  has no known <a data-link-type="dfn" href="infrastructure.html#size" id="ref-for-size-1">size</a>. (For example, the HTTP <code>Content-Length</code> header might
  provide this information.)</p>
    <p>The user agent must also keep track of the <dfn data-dfn-type="dfn" data-noexport="" id="number-of-bytes-downloaded">number of bytes downloaded<a class="self-link" href="infrastructure.html#number-of-bytes-downloaded"></a></dfn> for each
  instance of this algorithm. This number must exclude any out-of-band metadata, such as HTTP
  headers.</p>
    <p class="note" role="note"> The <a data-link-type="dfn" href="browsers.html#navigated" id="ref-for-navigated-3">navigation</a> processing model handles redirects itself, overriding the redirection
    handling that would be done by the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch">fetching algorithm</a>. </p>
    <p class="note" role="note"> Whether the <a href="infrastructure.html#content-type-sniffing">type sniffing rules</a> apply to the fetched resource depends on the algorithm
    that invokes the rules — they are not always applicable. </p>
    <h4 class="heading settled" data-level="2.6.3" id="encrypted-http-and-related-security-concerns"><span class="secno">2.6.3. </span><span class="content">Encrypted HTTP and related security concerns</span><a class="self-link" href="infrastructure.html#encrypted-http-and-related-security-concerns"></a></h4>
    <p>Anything in this specification that refers to HTTP also applies to HTTP-over-TLS, as represented
  by <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URLs</a> representing the <code>https</code> scheme. <a data-link-type="biblio" href="references.html#biblio-http">[HTTP]</a></p>
    <p class="warning"> User agents should report certificate errors to the user and must either refuse to download
    resources sent with erroneous certificates or must act as if such resources were in fact
    served with no encryption. </p>
    <p>User agents should warn the user that there is a potential problem whenever the user visits a
  page that the user has previously visited, if the page uses less secure encryption on the second
  visit.</p>
    <p>Not doing so can result in users not noticing man-in-the-middle attacks.</p>
    <div class="example" id="example-b6e4fb77">
     <a class="self-link" href="infrastructure.html#example-b6e4fb77"></a> If a user connects to a server with a self-signed certificate, the user agent could allow the
    connection but just act as if there had been no encryption. If the user agent instead allowed
    the user to override the problem and then displayed the page as if it was fully and safely
    encrypted, the user could be easily tricked into accepting man-in-the-middle connections. 
     <p>If a user connects to a server with full encryption, but the page then refers to an external
    resource that has an expired certificate, then the user agent will act as if the resource was
    unavailable, possibly also reporting the problem to the user. If the user agent instead
    allowed the resource to be used, then an attacker could just look for "secure" sites that used
    resources from a different host and only apply man-in-the-middle attacks to that host, for
    example taking over scripts in the page.</p>
     <p>If a user bookmarks a site that uses a CA-signed certificate, and then later revisits that
    site directly but the site has started using a self-signed certificate, the user agent could
    warn the user that a man-in-the-middle attack is likely underway, instead of simply acting as
    if the page was not encrypted.</p>
    </div>
    <h4 class="heading settled" data-level="2.6.4" id="content-type-sniffing"><span class="secno">2.6.4. </span><span class="content">Determining the type of a resource</span><a class="self-link" href="infrastructure.html#content-type-sniffing"></a></h4>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="content-type metadata|associated content-type headers|associated content-type metadata|explicit content-type metadata|content-type|the resource’s content-type metadata|type information" data-noexport="" id="content-type-metadata">Content-Type metadata</dfn> of a resource must be obtained and interpreted in a manner
  consistent with the requirements of the MIME Sniffing specification. <a data-link-type="biblio" href="references.html#biblio-mimesniff">[MIMESNIFF]</a></p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="computed type of the resource|computed type of a resource|image sniffing|computed MIME type" data-noexport="" id="computed-type-of-the-resource">computed type of a resource</dfn> must be found in a manner consistent with the requirements given in the MIME Sniffing
  specification for finding the <i>computed media type</i> of the relevant sequence of octets. <a data-link-type="biblio" href="references.html#biblio-mimesniff">[MIMESNIFF]</a></p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="image sniffing rules|rules for sniffing images specifically" data-noexport="" id="image-sniffing-rules">rules for sniffing images specifically</dfn> and the <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="rules for distinguishing if a resource is text or binary" data-noexport="" id="rules-for-distinguishing-if-a-resource-is-text-or-binary">rules for distinguishing if a
  resource is text or binary</dfn> are also defined in the MIME Sniffing specification. Both sets
  of rules return a <a data-link-type="dfn" href="infrastructure.html#mime-type" id="ref-for-mime-type-6">MIME type</a> as their result. <a data-link-type="biblio" href="references.html#biblio-mimesniff">[MIMESNIFF]</a></p>
    <p class="warning"> It is imperative that the rules in the MIME Sniffing specification be followed exactly. When a
    user agent uses different heuristics for content type detection than the server expects,
    security problems can occur. For more details, see the MIME Sniffing specification. <a data-link-type="biblio" href="references.html#biblio-mimesniff">[MIMESNIFF]</a> </p>
    <h4 class="heading settled" data-level="2.6.5" id="extracting-character-encodings-from-meta-elements"><span class="secno">2.6.5. </span><span class="content">Extracting character encodings from <code><a data-link-type="element" href="document-metadata.html#elementdef-meta" id="ref-for-elementdef-meta-2">meta</a></code> elements</span><a class="self-link" href="infrastructure.html#extracting-character-encodings-from-meta-elements"></a></h4>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="algorithm-for-extracting-a-character-encoding-from-a-meta-element">algorithm for extracting a character encoding from a <code><a data-link-type="element" href="document-metadata.html#elementdef-meta" id="ref-for-elementdef-meta-3">meta</a></code> element</dfn>,
  given a string <var>s</var>, is as follows. It either returns a character encoding or nothing.</p>
    <ol>
     <li data-md="">
      <p>Let <var>position</var> be a pointer into <var>s</var>, initially pointing at the start of
  the string.</p>
     </li><li data-md="">
      <p><i>Loop</i>: Find the first seven characters in <var>s</var> after <var>position</var> that
  are an <a data-link-type="dfn" href="infrastructure.html#ascii-case-insensitive" id="ref-for-ascii-case-insensitive-6">ASCII case-insensitive</a> match for the word "<code>charset</code>". If no such
  match is found, return nothing and abort these steps.</p>
     </li><li data-md="">
      <p>Skip any <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-23">space characters</a> that immediately follow the word "<code>charset</code>"
  (there might not be any).</p>
     </li><li data-md="">
      <p>If the next character is not a U+003D EQUALS SIGN (=), then move <var>position</var> to point
  just before that next character, and jump back to the step labeled <i>loop</i>.</p>
     </li><li data-md="">
      <p>Skip any <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-24">space characters</a> that immediately follow the equals sign (there might not be
  any).</p>
     </li><li data-md="">
      <p>Process the next character as follows:</p>
      <dl class="switch">
       <dt> If it is a U+0022 QUOTATION MARK character (") and there is a later U+0022 QUOTATION
      MARK character (") in <var>s</var> 
       </dt><dt> If it is a U+0027 APOSTROPHE character (') and there is a later U+0027 APOSTROPHE
      character (') in <var>s</var> 
       </dt><dd> Return the result of <a data-link-type="dfn" href="infrastructure.html#getting-an-encoding" id="ref-for-getting-an-encoding-1">getting an encoding</a> from the substring that is between
      this character and the next earliest occurrence of this character. 
       </dd><dt>If it is an unmatched U+0022 QUOTATION MARK character (")
       </dt><dt>If it is an unmatched U+0027 APOSTROPHE character (')
       </dt><dt>If there is no next character
       </dt><dd>Return nothing.
       </dd><dt>Otherwise
       </dt><dd> Return the result of <a data-link-type="dfn" href="infrastructure.html#getting-an-encoding" id="ref-for-getting-an-encoding-2">getting an encoding</a> from the substring that consists of this
      character up to but not including the first <a data-link-type="dfn" href="infrastructure.html#space-characters" id="ref-for-space-characters-25">space character</a> or U+003B SEMICOLON
      character (;), or the end of <var>s</var>, whichever comes first. 
      </dd></dl>
    </li></ol>
    <p class="note" role="note"> This algorithm is distinct from those in the HTTP specification (for example, HTTP doesn’t
    allow the use of single quotes and requires supporting a backslash-escape mechanism that is
    not supported by this algorithm). While the algorithm is used in contexts that, historically,
    were related to HTTP, the syntax as supported by implementations diverged some time ago. <a data-link-type="biblio" href="references.html#biblio-http">[HTTP]</a> </p>
    <h4 class="heading settled" data-level="2.6.6" id="cors-settings-attributes"><span class="secno">2.6.6. </span><span class="content">CORS settings attributes</span><a class="self-link" href="infrastructure.html#cors-settings-attributes"></a></h4>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="cors-settings-attribute">CORS settings attribute</dfn> is an <a data-link-type="dfn" href="infrastructure.html#enumerated-attributes" id="ref-for-enumerated-attributes-1">enumerated attribute</a>. The following table lists
  the keywords and states for the attribute — the keywords in the left column map to the
  states in the cell in the second column on the same row as the keyword.</p>
    <table>
     <thead>
      <tr>
       <th>Keyword
       </th><th>State
       </th><th>Brief description
     </th></tr></thead><tbody>
      <tr>
       <td><dfn class="dfn-paneled css" data-dfn-for="cors" data-dfn-type="value" data-export="" id="valdef-cors-anonymous"><code>anonymous</code></dfn>
       </td><td><dfn class="dfn-paneled" data-dfn-for="cors" data-dfn-type="state" data-export="" id="statedef-cors-anonymous">Anonymous</dfn>
       </td><td> <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request">Requests</a> for the element will have their <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-mode">mode</a> set to "<code>cors</code>" and
          their <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-credentials-mode">credentials mode</a> set to "<code>same-origin</code>". 
      </td></tr><tr>
       <td><dfn class="dfn-paneled css" data-dfn-for="cors" data-dfn-type="value" data-export="" id="valdef-cors-use-credentials"><code>use-credentials</code></dfn>
       </td><td><dfn data-dfn-for="cors" data-dfn-type="state" data-export="" id="statedef-cors-use-credentials">Use Credentials<a class="self-link" href="infrastructure.html#statedef-cors-use-credentials"></a></dfn>
       </td><td> <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request">Requests</a> for the element will have their <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-mode">mode</a> set to "<code>cors</code>" and
          their <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-credentials-mode">credentials mode</a> set to "<code>include</code>". 
    </td></tr></tbody></table>
    <p>The empty string is also a valid keyword, and maps to the <a data-link-type="state" href="infrastructure.html#statedef-cors-anonymous" id="ref-for-statedef-cors-anonymous-1">Anonymous</a> state. The attribute’s <i>invalid value default</i> is the <a data-link-type="state" href="infrastructure.html#statedef-cors-anonymous" id="ref-for-statedef-cors-anonymous-2">Anonymous</a> state. For the purposes of <a data-link-type="dfn" href="infrastructure.html#reflection" id="ref-for-reflection-2">reflection</a>,
  the canonical case for the <a data-link-type="state" href="infrastructure.html#statedef-cors-anonymous" id="ref-for-statedef-cors-anonymous-3">Anonymous</a> state is the <a class="css" data-link-type="value" href="infrastructure.html#valdef-cors-anonymous" id="ref-for-valdef-cors-anonymous-1"><code>anonymous</code></a> keyword. The <i>missing value default</i>, used when the attribute is omitted, is the <dfn class="dfn-paneled" data-dfn-for="cors" data-dfn-type="state" data-export="" id="statedef-cors-no-cors">No CORS</dfn> state.</p>
    <h3 class="heading settled" data-level="2.7" id="common-dom-interfaces"><span class="secno">2.7. </span><span class="content">Common DOM interfaces</span><a class="self-link" href="infrastructure.html#common-dom-interfaces"></a></h3>
    <h4 class="heading settled" data-level="2.7.1" id="reflecting-content-attributes-in-idl-attributes"><span class="secno">2.7.1. </span><span class="content">Reflecting content attributes in IDL attributes</span><a class="self-link" href="infrastructure.html#reflecting-content-attributes-in-idl-attributes"></a></h4>
    <p>Some IDL attributes are defined to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="reflection|reflect" data-noexport="" id="reflection">reflect</dfn> a particular content attribute. This means
  that on getting, the IDL attribute returns the current value of the content attribute, and on
  setting, the IDL attribute changes the value of the content attribute to the given value.</p>
    <p>In general, on getting, if the content attribute is not present, the IDL attribute must act as
  if the content attribute’s value is the empty string; and on setting, if the content attribute
  is not present, it must first be added.</p>
    <p>If a reflecting IDL attribute is a <code>DOMString</code> attribute whose content attribute is
  defined to contain a <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URL</a>, then on getting, the IDL attribute must <a data-link-type="dfn" href="infrastructure.html#reparsed" id="ref-for-reparsed-4">parse</a> the
  value of the content attribute relative to the element and return the resulting <a data-link-type="dfn" href="https://url.spec.whatwg.org/#syntax-url-absolute">absolute URL</a> if that was successful, or the empty string otherwise; and on setting, must
  set the content attribute to the specified literal value. If the content attribute is absent,
  the IDL attribute must return the default value, if the content attribute has one, or else the
  empty string.</p>
    <p>If a reflecting IDL attribute is a <code>DOMString</code> attribute whose content attribute is
  defined to contain one or more <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-url">URLs</a>, then on getting, the IDL attribute must <a data-link-type="dfn" href="infrastructure.html#split-a-string-on-spaces" id="ref-for-split-a-string-on-spaces-2">split the
  content attribute on spaces</a> and return the concatenation of <a data-link-type="dfn" href="infrastructure.html#reparsed" id="ref-for-reparsed-5">parsing</a> each token URL
  to an <a data-link-type="dfn" href="https://url.spec.whatwg.org/#syntax-url-absolute">absolute URL</a> relative to the element, with a single U+0020 SPACE character between
  each URL, ignoring any tokens that did not resolve successfully. If the content attribute is
  absent, the IDL attribute must return the default value, if the content attribute has one, or
  else the empty string. On setting, the IDL attribute must set the content attribute to the
  specified literal value.</p>
    <p>If a reflecting IDL attribute is a <code>DOMString</code> attribute whose content attribute is
  an <a data-link-type="dfn" href="infrastructure.html#enumerated-attributes" id="ref-for-enumerated-attributes-2">enumerated attribute</a>, and the IDL attribute is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="limited-to-only-known-values">limited to only known values</dfn>,
  then, on getting, the IDL attribute must return the conforming value associated with the state
  the attribute is in (in its canonical case), if any, or the empty string if the attribute is in
  a state that has no associated keyword value or if the attribute is not in a defined state (e.g.,
  the attribute is missing and there is no <i>missing value default</i>); and on setting, the
  content attribute must be set to the specified new value.</p>
    <p>If a reflecting IDL attribute is a nullable <code>DOMString</code> attribute whose content
  attribute is an <a data-link-type="dfn" href="infrastructure.html#enumerated-attributes" id="ref-for-enumerated-attributes-3">enumerated attribute</a>, then, on getting, if the corresponding content
  attribute is in its <i>missing value default</i> then the IDL attribute must return null,
  otherwise, the IDL attribute must return the conforming value associated with the state the
  attribute is in (in its canonical case); and on setting, if the new value is null, the content
  attribute must be removed, and otherwise, the content attribute must be set to the specified new
  value.</p>
    <p>If a reflecting IDL attribute is a <code>DOMString</code> attribute but doesn’t fall into any
  of the above categories, then the getting and setting must be done in a transparent,
  case-preserving manner.</p>
    <p>If a reflecting IDL attribute is a <code>boolean</code> attribute, then on getting the IDL
  attribute must return true if the content attribute is set, and false if it is absent. On
  setting, the content attribute must be removed if the IDL attribute is set to false, and must be
  set to the empty string if the IDL attribute is set to true. (This corresponds to the rules for <a data-link-type="dfn" href="infrastructure.html#boolean-attribute" id="ref-for-boolean-attribute-3">boolean content attributes</a>.)</p>
    <p>If a reflecting IDL attribute has a signed integer type (<code>long</code>) then, on getting,
  the content attribute must be parsed according to the <a data-link-type="dfn" href="infrastructure.html#parse-token-as-an-integer" id="ref-for-parse-token-as-an-integer-3">rules for parsing signed integers</a>,
  and if that is successful, and the value is in the range of the IDL attribute’s type, the
  resulting value must be returned. If, on the other hand, it fails or returns an out of range
  value, or if the attribute is absent, then the default value must be returned instead, or 0 if
  there is no default value. On setting, the given value must be converted to the shortest
  possible string representing the number as a <a data-link-type="dfn" href="infrastructure.html#valid-integer" id="ref-for-valid-integer-5">valid integer</a> and then that string must be
  used as the new content attribute value.</p>
    <p>If a reflecting IDL attribute has a signed integer type (<code>long</code>)
  that is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="limited-to-only-non-negative-numbers">limited to only non-negative numbers</dfn> then, on getting, the content attribute
  must be parsed according to the <a data-link-type="dfn" href="infrastructure.html#parse-that-attributes-value" id="ref-for-parse-that-attributes-value-1">rules for parsing non-negative integers</a>, and if that
  is successful, and the value is in the range of the IDL attribute’s type, the resulting value
  must be returned. If, on the other hand, it fails or returns an out of range value, or if the
  attribute is absent, the default value must be returned instead, or -1 if there is no
  default value. On setting, if the value is negative, the user agent must throw an <code>IndexSizeError</code> exception. Otherwise, the given value must be converted to the
  shortest possible string representing the number as a <a data-link-type="dfn" href="infrastructure.html#valid-non-negative-integer" id="ref-for-valid-non-negative-integer-2">valid non-negative integer</a> and then
  that string must be used as the new content attribute value.</p>
    <p>If a reflecting IDL attribute has an <em>unsigned</em> integer type (<code>unsigned long</code>)
  then, on getting, the content attribute must be parsed according to the <a data-link-type="dfn" href="infrastructure.html#parse-that-attributes-value" id="ref-for-parse-that-attributes-value-2">rules for parsing
  non-negative integers</a>, and if that is successful, and the value is in the range 0 to
  2147483647 inclusive, the resulting value must be returned. If, on the other hand, it fails or
  returns an out of range value, or if the attribute is absent, the default value must be returned
  instead, or 0 if there is no default value. On setting, first, if the new value is in the range
  0 to 2147483647, then let <var>n</var> be the new value, otherwise let <var>n</var> be the
  default value, or 0 if there is no default value; then, <var>n</var> must be converted to the
  shortest possible string representing the number as a <a data-link-type="dfn" href="infrastructure.html#valid-non-negative-integer" id="ref-for-valid-non-negative-integer-3">valid non-negative integer</a> and that
  string must be used as the new content attribute value.</p>
    <p>If a reflecting IDL attribute has an unsigned integer type (<code>unsigned long</code>) that is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="limited-to-only-non-negative-numbers-greater-than-zero">limited to only non-negative numbers greater than zero</dfn>, then the behavior is similar
  to the previous case, but zero is not allowed. On getting, the content attribute must first be
  parsed according to the <a data-link-type="dfn" href="infrastructure.html#parse-that-attributes-value" id="ref-for-parse-that-attributes-value-3">rules for parsing non-negative integers</a>, and if that is
  successful, and the value is in the range 1 to 2147483647 inclusive, the resulting value must be
  returned. If, on the other hand, it fails or returns an out of range value, or if the attribute
  is absent, the default value must be returned instead, or 1 if there is no default value. On
  setting, if the value is zero, the user agent must throw an <code>IndexSizeError</code> exception. Otherwise, first, if the new value is in the range 1 to 2147483647, then let <var>n</var> be the new value, otherwise let <var>n</var> be the default value, or 1 if there is
  no default value; then, <var>n</var> must be converted to the shortest possible string
  representing the number as a <a data-link-type="dfn" href="infrastructure.html#valid-non-negative-integer" id="ref-for-valid-non-negative-integer-4">valid non-negative integer</a> and that string must be used as
  the new content attribute value.</p>
    <p>If a reflecting IDL attribute has a floating-point number type (<code>double</code> or <code>unrestricted double</code>), then, on getting, the content attribute must be parsed
  according to the <a data-link-type="dfn" href="infrastructure.html#rules-for-parsing-floating-point-number-values" id="ref-for-rules-for-parsing-floating-point-number-values-2">rules for parsing floating-point number values</a>, and if that is
  successful, the resulting value must be returned. If, on the other hand, it fails, or if the
  attribute is absent, the default value must be returned instead, or 0.0 if there is no default
  value. On setting, the given value must be converted to the <a data-link-type="dfn" href="infrastructure.html#best-floating-point-number" id="ref-for-best-floating-point-number-1">best representation of the number as a floating-point number</a> and then that string must be used as the new content attribute value.</p>
    <p>If a reflecting IDL attribute has a floating-point number type (<code>double</code> or <code>unrestricted double</code>) that is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="limited-to-numbers-greater-than-zero">limited to numbers greater than zero</dfn>, then
  the behavior is similar to the previous case, but zero and negative values are not allowed. On
  getting, the content attribute must be parsed according to the <a data-link-type="dfn" href="infrastructure.html#rules-for-parsing-floating-point-number-values" id="ref-for-rules-for-parsing-floating-point-number-values-3">rules for parsing
  floating-point number values</a>, and if that is successful and the value is greater than 0.0,
  the resulting value must be returned. If, on the other hand, it fails or returns an out of range
  value, or if the attribute is absent, the default value must be returned instead, or 0.0 if
  there is no default value. On setting, if the value is less than or equal to zero, then the
  value must be ignored. Otherwise, the given value must be converted to the <a data-link-type="dfn" href="infrastructure.html#best-floating-point-number" id="ref-for-best-floating-point-number-2">best representation of the number as a floating-point number</a> and then that string must be used as the new content attribute value.</p>
    <p class="note" role="note"> The values Infinity and Not-a-Number (NaN) values throw an exception on setting, as defined in
    the Web IDL specification. <a data-link-type="biblio" href="references.html#biblio-webidl">[WEBIDL]</a> </p>
    <p>If a reflecting IDL attribute has the type <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#domtokenlist">DOMTokenList</a></code>, then on getting it must return a <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#domtokenlist">DOMTokenList</a></code> object whose associated element is the element in question and whose associated
  attribute’s local name is the name of the attribute in question. The same <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#domtokenlist">DOMTokenList</a></code> object must be returned every time for each attribute.</p>
    <p>If a reflecting IDL attribute has the type <code class="idl"><a data-link-type="idl" href="dom.html#htmlelement-htmlelement" id="ref-for-htmlelement-htmlelement-1">HTMLElement</a></code>, or an interface that
  descends from <code class="idl"><a data-link-type="idl" href="dom.html#htmlelement-htmlelement" id="ref-for-htmlelement-htmlelement-2">HTMLElement</a></code>, then, on getting, it must run the following algorithm
  (stopping at the first point where a value is returned):</p>
    <ol>
     <li data-md="">
      <p>If the corresponding content attribute is absent, then the IDL attribute must return null.</p>
     </li><li data-md="">
      <p>Let <var>candidate</var> be the element that the <code>document.getElementById()</code> method would find when called on the content attribute’s element’s <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-document">node document</a> if
  it were passed as its argument the current value of the corresponding content attribute.</p>
     </li><li data-md="">
      <p>If <var>candidate</var> is null, or if it is not type-compatible with the IDL attribute, then
  the IDL attribute must return null.</p>
     </li><li data-md="">
      <p>Otherwise, it must return <var>candidate</var>.</p>
    </li></ol>
    <p>On setting, if the given element has an <code>id</code> attribute, and has the same <a data-link-type="dfn" href="infrastructure.html#home-subtree" id="ref-for-home-subtree-2">home subtree</a> as the element of the attribute being set, and the given element is the
  first element in that <a data-link-type="dfn" href="infrastructure.html#home-subtree" id="ref-for-home-subtree-3">home subtree</a> whose <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-id">ID</a> is the value of that <code>id</code> attribute, then the content attribute must be set to the value of that <code>id</code> attribute. Otherwise, the content attribute must be set to the empty string.</p>
    <h4 class="heading settled" data-level="2.7.2" id="collections"><span class="secno">2.7.2. </span><span class="content">Collections</span><a class="self-link" href="infrastructure.html#collections"></a></h4>
    <p>The <code class="idl"><a data-link-type="idl" href="infrastructure.html#htmlformcontrolscollection-htmlformcontrolscollection" id="ref-for-htmlformcontrolscollection-htmlformcontrolscollection-1">HTMLFormControlsCollection</a></code> and <code class="idl"><a data-link-type="idl" href="infrastructure.html#htmloptionscollection-htmloptionscollection" id="ref-for-htmloptionscollection-htmloptionscollection-1">HTMLOptionsCollection</a></code> interfaces are <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-collection">collections</a> derived from the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#htmlcollection">HTMLCollection</a></code> interface. The <code class="idl"><a data-link-type="idl" href="infrastructure.html#htmlallcollection-htmlallcollection" id="ref-for-htmlallcollection-htmlallcollection-1">HTMLAllCollection</a></code> however, is independent as it has a variety of unique quirks that are not
  desirable to inherit from <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#htmlcollection">HTMLCollection</a></code>.</p>
    <h5 class="heading settled" data-level="2.7.2.1" id="the-htmlallcollection-interface"><span class="secno">2.7.2.1. </span><span class="content">The <code>HTMLAllCollection</code> interface</span><a class="self-link" href="infrastructure.html#the-htmlallcollection-interface"></a></h5>
    <p>The <code>HTMLAllCollection</code> interface is used for the legacy <code>document.all</code> attribute. It operates similarly to <code>HTMLCollection</code>; it also supports a variety of
  other legacy features required for web compatibility such as the ability to be invoked like a
  function (<code>legacycaller</code>).</p>
    <p class="note" role="note"> All <code>HTMLAllCollection</code> objects are rooted at a <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> and have a filter that
    matches all elements, so the elements <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#represented-by-the-collection">represented by the collection</a> of an <code class="idl"><a data-link-type="idl" href="infrastructure.html#htmlallcollection-htmlallcollection" id="ref-for-htmlallcollection-htmlallcollection-2">HTMLAllCollection</a></code> object consist of all the descendant elements of the root <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code>. </p>
<pre class="idl highlight def" data-highlight="webidl">[<a class="nv idl-code" data-link-type="extended-attribute">LegacyUnenumerableNamedProperties</a>]
<span class="kt">interface</span> <dfn class="nv dfn-paneled idl-code" data-dfn-for="HTMLAllCollection" data-dfn-type="interface" data-export="" id="htmlallcollection-htmlallcollection">HTMLAllCollection</dfn> {
  <span class="kt">readonly</span> <span class="kt">attribute</span> <span class="kt">unsigned</span> <span class="kt">long</span> <a class="nv idl-code" data-link-type="attribute" data-readonly="" data-type="unsigned long" href="infrastructure.html#dom-htmlallcollection-length" id="ref-for-dom-htmlallcollection-length-1">length</a>;
  <span class="kt">getter</span> <a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/dom/#interface-element">Element</a>? (<span class="kt">unsigned</span> <span class="kt">long</span> <dfn class="nv idl-code" data-dfn-for="HTMLAllCollection/__getter__(index)" data-dfn-type="argument" data-export="" id="dom-htmlallcollection-__getter__-index-index">index<a class="self-link" href="infrastructure.html#dom-htmlallcollection-__getter__-index-index"></a></dfn>);
  <span class="kt">getter</span> (<a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/dom/#htmlcollection">HTMLCollection</a> <span class="kt">or</span> <a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/dom/#interface-element">Element</a>)? <a class="nv idl-code" data-link-type="method" href="infrastructure.html#dom-htmlallcollection-nameditem" id="ref-for-dom-htmlallcollection-nameditem-1">namedItem</a>(<span class="kt">DOMString</span> <dfn class="nv idl-code" data-dfn-for="HTMLAllCollection/namedItem(name)" data-dfn-type="argument" data-export="" id="dom-htmlallcollection-nameditem-name-name">name<a class="self-link" href="infrastructure.html#dom-htmlallcollection-nameditem-name-name"></a></dfn>);
  <span class="kt">legacycaller</span> (<a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/dom/#htmlcollection">HTMLCollection</a> <span class="kt">or</span> <a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/dom/#interface-element">Element</a>)? <a class="nv idl-code" data-link-type="method" href="infrastructure.html#dom-htmlallcollection-item" id="ref-for-dom-htmlallcollection-item-1">item</a>(<span class="kt">optional</span> <span class="kt">DOMString</span> <dfn class="nv idl-code" data-dfn-for="HTMLAllCollection/item(nameOrItem), HTMLAllCollection/item()" data-dfn-type="argument" data-export="" id="dom-htmlallcollection-item-nameoritem-nameoritem">nameOrItem<a class="self-link" href="infrastructure.html#dom-htmlallcollection-item-nameoritem-nameoritem"></a></dfn>);
};
</pre>
    <dl class="domintro">
     <dt><var>collection</var> . <code class="idl"><a data-link-type="idl" href="infrastructure.html#dom-htmlallcollection-length" id="ref-for-dom-htmlallcollection-length-2">length</a></code>
     </dt><dd>Returns the number of elements in the collection.
     </dd><dt><var>element</var> = <var>collection</var> . <code class="idl"><a data-link-type="idl" href="infrastructure.html#dom-htmlallcollection-item" id="ref-for-dom-htmlallcollection-item-2">item</a></code>(<var>index</var>)
     </dt><dt><var>element</var> = <var>collection</var>(<var>index</var>)
     </dt><dt><var>element</var> = <var>collection</var>[<var>index</var>]
     </dt><dd>Returns the item with index <var>index</var> from the collection (determined by <a data-link-type="dfn" href="infrastructure.html#tree-order" id="ref-for-tree-order-4">tree order</a>.
     </dd><dt><var>element</var> = <var>collection</var> . <code class="idl"><a data-link-type="idl" href="infrastructure.html#dom-htmlallcollection-item" id="ref-for-dom-htmlallcollection-item-3">item</a></code>(<var>name</var>)
     </dt><dt><var>collection</var> = <var>collection</var> . <code class="idl"><a data-link-type="idl" href="infrastructure.html#dom-htmlallcollection-item" id="ref-for-dom-htmlallcollection-item-4">item</a></code>(<var>name</var>)
     </dt><dt><var>element</var> = <var>collection</var> . <code class="idl"><a data-link-type="idl" href="infrastructure.html#dom-htmlallcollection-nameditem" id="ref-for-dom-htmlallcollection-nameditem-2">namedItem</a></code>(<var>name</var>)
     </dt><dt><var>collection</var> = <var>collection</var> . <code class="idl"><a data-link-type="idl" href="infrastructure.html#dom-htmlallcollection-nameditem" id="ref-for-dom-htmlallcollection-nameditem-3">namedItem</a></code>(<var>name</var>)
     </dt><dt><var>element</var> = <var>collection</var>(<var>name</var>)
     </dt><dt><var>collection</var> = <var>collection</var>(<var>name</var>)
     </dt><dt><var>element</var> = <var>collection</var>[<var>name</var>]
     </dt><dt><var>collection</var> = <var>collection</var>[<var>name</var>]
     </dt><dd>
      Returns the item with <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-id">ID</a> or name <var>name</var> from the collection. 
      <p>If there are multiple matching items, then an <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#htmlcollection">HTMLCollection</a></code> object containing all those
    elements is returned.</p>
      <p>The <code><a data-link-type="element-sub" href="sec-forms.html#element-attrdef-formelements-name" id="ref-for-element-attrdef-formelements-name-1">name</a></code> attribute’s value provides a name for <code><a data-link-type="element" href="sec-forms.html#elementdef-button" id="ref-for-elementdef-button-5">button</a></code>, <code><a data-link-type="element" href="sec-forms.html#elementdef-input" id="ref-for-elementdef-input-1">input</a></code>, <code><a data-link-type="element" href="sec-forms.html#elementdef-select" id="ref-for-elementdef-select-1">select</a></code>, and <code><a data-link-type="element" href="sec-forms.html#elementdef-textarea" id="ref-for-elementdef-textarea-2">textarea</a></code>. Similarly, <code><a data-link-type="element" href="semantics-embedded-content.html#elementdef-iframe" id="ref-for-elementdef-iframe-4">iframe</a></code>'s <code><a data-link-type="element-sub" href="semantics-embedded-content.html#element-attrdef-iframe-name" id="ref-for-element-attrdef-iframe-name-1">name</a></code>, <code><a data-link-type="element" href="semantics-embedded-content.html#elementdef-object" id="ref-for-elementdef-object-1">object</a></code>'s <code><a data-link-type="element-sub" href="semantics-embedded-content.html#element-attrdef-object-name" id="ref-for-element-attrdef-object-name-1">name</a></code>, <code><a data-link-type="element" href="document-metadata.html#elementdef-meta" id="ref-for-elementdef-meta-4">meta</a></code>'s <code><a data-link-type="element-sub" href="document-metadata.html#element-attrdef-meta-name" id="ref-for-element-attrdef-meta-name-1">name</a></code>, <code><a data-link-type="element" href="semantics-embedded-content.html#elementdef-map" id="ref-for-elementdef-map-1">map</a></code>'s <code><a data-link-type="element-sub" href="semantics-embedded-content.html#element-attrdef-map-name" id="ref-for-element-attrdef-map-name-1">name</a></code>, and <code><a data-link-type="element" href="sec-forms.html#elementdef-form" id="ref-for-elementdef-form-3">form</a></code>'s <code><a data-link-type="element-sub" href="sec-forms.html#element-attrdef-form-name" id="ref-for-element-attrdef-form-name-1">name</a></code> attribute’s value provides a name for their respective elements. Only the elements mentioned
    have a <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="named for the all collection" data-noexport="" id="named-for-the-all-collection">name</dfn> for the purpose of this method.</p>
     <p></p>
    </dd></dl>
    <p>The object’s <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#dfn-supported-property-indices">supported property indices</a> are as defined for <code>HTMLCollection</code> objects.</p>
    <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL/#dfn-supported-property-names">supported property names</a> consist of the non-empty values of all the <code><a data-link-type="element-sub" href="dom.html#element-attrdef-global-id" id="ref-for-element-attrdef-global-id-2">id</a></code> and <a data-link-type="dfn" href="infrastructure.html#named-for-the-all-collection" id="ref-for-named-for-the-all-collection-1">name</a> attributes of all the elements <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#represented-by-the-collection">represented by the collection</a>, in <a data-link-type="dfn" href="infrastructure.html#tree-order" id="ref-for-tree-order-5">tree order</a>, ignoring later duplicates, with the <code><a data-link-type="element-sub" href="dom.html#element-attrdef-global-id" id="ref-for-element-attrdef-global-id-3">id</a></code> of an element preceding its <a data-link-type="dfn" href="infrastructure.html#named-for-the-all-collection" id="ref-for-named-for-the-all-collection-2">name</a> if it
  contributes both, they differ from each other, and neither is the duplicate of an earlier entry.</p>
    <p>On getting, the <dfn class="dfn-paneled idl-code" data-dfn-for="HTMLAllCollection" data-dfn-type="attribute" data-export="" id="dom-htmlallcollection-length"><code>length</code></dfn> attribute must
  return the number of nodes <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#represented-by-the-collection">represented by the collection</a>.</p>
    <p>The indexed property getter must return the result of <a data-link-type="dfn" href="infrastructure.html#get-all-indexed" id="ref-for-get-all-indexed-1">getting the "all"-indexed element</a> from this <code class="idl"><a data-link-type="idl" href="infrastructure.html#htmlallcollection-htmlallcollection" id="ref-for-htmlallcollection-htmlallcollection-3">HTMLAllCollection</a></code> given the passed index.</p>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="HTMLAllCollection" data-dfn-type="method" data-export="" id="dom-htmlallcollection-nameditem"><code>namedItem(<var>name</var>)</code></dfn> method
  must return the result of <a data-link-type="dfn" href="infrastructure.html#get-all-named" id="ref-for-get-all-named-1">getting the "all"-named element or elements</a> from this <code class="idl"><a data-link-type="idl" href="infrastructure.html#htmlallcollection-htmlallcollection" id="ref-for-htmlallcollection-htmlallcollection-4">HTMLAllCollection</a></code> given <var>name</var>.</p>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="HTMLAllCollection" data-dfn-type="method" data-export="" data-lt="item(nameOrItem)|item()" id="dom-htmlallcollection-item"><code>item(<var>nameOrIndex</var>)</code></dfn> method
  (and the <code>legacycaller</code> behavior) must act according to the following algorithm:</p>
    <ol>
     <li data-md="">
      <p>If <var>nameOrIndex</var> was not provided, return null.</p>
     </li><li data-md="">
      <p>If <var>nameOrIndex</var>, <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#es-type-mapping">converted</a> to a JavaScript string value, is an <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-array-index-property-name">array index property name</a>, return the result of <a data-link-type="dfn" href="infrastructure.html#get-all-indexed" id="ref-for-get-all-indexed-2">getting the "all"-indexed element</a> from this <code class="idl"><a data-link-type="idl" href="infrastructure.html#htmlallcollection-htmlallcollection" id="ref-for-htmlallcollection-htmlallcollection-5">HTMLAllCollection</a></code> given the number represented by <var>nameOrIndex</var>.</p>
     </li><li data-md="">
      <p>Return the result of <a data-link-type="dfn" href="infrastructure.html#get-all-named" id="ref-for-get-all-named-2">getting the "all"-named element or elements</a> from
  this <code class="idl"><a data-link-type="idl" href="infrastructure.html#htmlallcollection-htmlallcollection" id="ref-for-htmlallcollection-htmlallcollection-6">HTMLAllCollection</a></code> given <var>nameOrIndex</var>.</p>
    </li></ol>
    <p>The following elements are considered <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="all-named-elements">"all"-named elements</dfn>: <code><a data-link-type="element" href="textlevel-semantics.html#elementdef-a" id="ref-for-elementdef-a-4">a</a></code>, <code><a data-link-type="element" href="obsolete.html#elementdef-applet" id="ref-for-elementdef-applet-1">applet</a></code>, <code><a data-link-type="element" href="sec-forms.html#elementdef-button" id="ref-for-elementdef-button-6">button</a></code>, <code><a data-link-type="element" href="semantics-embedded-content.html#elementdef-embed" id="ref-for-elementdef-embed-2">embed</a></code>, <code><a data-link-type="element" href="sec-forms.html#elementdef-form" id="ref-for-elementdef-form-4">form</a></code>, <code><a data-link-type="element" href="obsolete.html#elementdef-frame" id="ref-for-elementdef-frame-1">frame</a></code>, <code><a data-link-type="element" href="obsolete.html#elementdef-frameset" id="ref-for-elementdef-frameset-1">frameset</a></code>, <code><a data-link-type="element" href="semantics-embedded-content.html#elementdef-iframe" id="ref-for-elementdef-iframe-5">iframe</a></code>, <code><a data-link-type="element" href="semantics-embedded-content.html#elementdef-img" id="ref-for-elementdef-img-5">img</a></code>, <code><a data-link-type="element" href="sec-forms.html#elementdef-input" id="ref-for-elementdef-input-2">input</a></code>, <code><a data-link-type="element" href="semantics-embedded-content.html#elementdef-map" id="ref-for-elementdef-map-2">map</a></code>, <code><a data-link-type="element" href="document-metadata.html#elementdef-meta" id="ref-for-elementdef-meta-5">meta</a></code>, <code><a data-link-type="element" href="semantics-embedded-content.html#elementdef-object" id="ref-for-elementdef-object-2">object</a></code>, <code><a data-link-type="element" href="sec-forms.html#elementdef-select" id="ref-for-elementdef-select-2">select</a></code>, and <code><a data-link-type="element" href="sec-forms.html#elementdef-textarea" id="ref-for-elementdef-textarea-3">textarea</a></code>.</p>
    <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="get all-indexed" data-noexport="" id="get-all-indexed">get the "all"-indexed element</dfn> from an <code class="idl"><a data-link-type="idl" href="infrastructure.html#htmlallcollection-htmlallcollection" id="ref-for-htmlallcollection-htmlallcollection-7">HTMLAllCollection</a></code> <var>collection</var> given an index <var>index</var>, return the element
  with index <var>index</var> in <var>collection</var>, or null if there is no such element at <var>index</var>.</p>
    <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="get all-named" data-noexport="" id="get-all-named">get the "all"-named element or elements</dfn> from an <code class="idl"><a data-link-type="idl" href="infrastructure.html#htmlallcollection-htmlallcollection" id="ref-for-htmlallcollection-htmlallcollection-8">HTMLAllCollection</a></code> <var>collection</var> given a name <var>name</var>, run the
  following algorithm:</p>
    <ol>
     <li data-md="">
      <p>If <var>name</var> is the empty string, return null.</p>
     </li><li data-md="">
      <p>Let <var>subCollection</var> be an <code>HTMLCollection</code> object rooted at the same <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> as <var>collection</var>, whose filter matches only elements that are either:</p>
      <ul>
       <li data-md="">
        <p><a data-link-type="dfn" href="infrastructure.html#all-named-elements" id="ref-for-all-named-elements-1">"all"-named elements</a> with a <a data-link-type="dfn" href="infrastructure.html#named-for-the-all-collection" id="ref-for-named-for-the-all-collection-3">name</a> attribute
 equal to <var>name</var>, or,</p>
       </li><li data-md="">
        <p>elements with an <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-id">ID</a> equal to <var>name</var>.</p>
      </li></ul>
     </li><li data-md="">
      <p>If there is exactly one element in <var>subCollection</var>, then return that element.</p>
     </li><li data-md="">
      <p>Otherwise, if <var>subCollection</var> is empty, return null.</p>
     </li><li data-md="">
      <p>Otherwise, return <var>subCollection</var>.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.7.2.2" id="the-htmlformcontrolscollection-interface"><span class="secno">2.7.2.2. </span><span class="content">The <code>HTMLFormControlsCollection</code> interface</span><a class="self-link" href="infrastructure.html#the-htmlformcontrolscollection-interface"></a></h5>
    <p>The <code>HTMLFormControlsCollection</code> interface is used for <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-collection">collections</a> of <a data-link-type="dfn" href="sec-forms.html#listed-element" id="ref-for-listed-element-1">listed elements</a> in <code><a data-link-type="element" href="sec-forms.html#elementdef-form" id="ref-for-elementdef-form-5">form</a></code> elements.</p>
<pre class="idl highlight def" data-highlight="webidl"><span class="kt">interface</span> <dfn class="nv dfn-paneled idl-code" data-dfn-for="HTMLFormControlsCollection" data-dfn-type="interface" data-export="" id="htmlformcontrolscollection-htmlformcontrolscollection">HTMLFormControlsCollection</dfn> : <a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/dom/#htmlcollection">HTMLCollection</a> {
  // inherits length and item()
  <span class="kt">getter</span> (<a class="n" data-link-type="idl-name" href="infrastructure.html#radionodelist-radionodelist" id="ref-for-radionodelist-radionodelist-1">RadioNodeList</a> <span class="kt">or</span> <a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/dom/#interface-element">Element</a>)? <a class="nv idl-code" data-link-type="method" href="infrastructure.html#dom-htmlformcontrolscollection-nameditem" id="ref-for-dom-htmlformcontrolscollection-nameditem-1">namedItem</a>(<span class="kt">DOMString</span> <dfn class="nv idl-code" data-dfn-for="HTMLFormControlsCollection/namedItem(name)" data-dfn-type="argument" data-export="" id="dom-htmlformcontrolscollection-nameditem-name-name">name<a class="self-link" href="infrastructure.html#dom-htmlformcontrolscollection-nameditem-name-name"></a></dfn>); // shadows inherited namedItem()
};
</pre>
<pre class="idl highlight def" data-highlight="webidl"><span class="kt">interface</span> <dfn class="nv dfn-paneled idl-code" data-dfn-for="RadioNodeList" data-dfn-type="interface" data-export="" id="radionodelist-radionodelist">RadioNodeList</dfn> : <a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/dom/#nodelist">NodeList</a> {
  <span class="kt">attribute</span> <span class="kt">DOMString</span> <dfn class="nv dfn-paneled idl-code" data-dfn-for="RadioNodeList" data-dfn-type="attribute" data-export="" data-type="DOMString" id="dom-radionodelist-value">value</dfn>;
};
</pre>
    <dl class="domintro">
     <dt><var>collection</var> . <code>length</code>
     </dt><dd>Returns the number of elements in the collection.
     </dd><dt><var>element</var> = <var>collection</var> . <code>item</code>(<var>index</var>)
     </dt><dt><var>element</var> = <var>collection</var>[<var>index</var>]
     </dt><dd> Returns the item with index <var>index</var> from the collection. The items are sorted in <a data-link-type="dfn" href="infrastructure.html#tree-order" id="ref-for-tree-order-6">tree order</a>. 
     </dd><dt><var>element</var> = <var>collection</var> . <code>namedItem</code>(<var>name</var>)
     </dt><dt> <var>radioNodeList</var> = <var>collection</var> . <code>namedItem</code>(<var>name</var>) 
     </dt><dt><var>element</var> = <var>collection</var>[<var>name</var>]
     </dt><dt><var>radioNodeList</var> = <var>collection</var>[<var>name</var>]
     </dt><dd>
       Returns the item with <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-id">ID</a> or <code>name</code> <var>name</var> from the collection. 
      <p>If there are multiple matching items, then a <code>RadioNodeList</code> object containing all
      those elements is returned.</p>
     </dd><dt><var>radioNodeList</var> . <var>value</var> [ = <var>value</var> ]
     </dt><dd>
       Returns the value of the first checked radio button represented by the object. 
      <p>Can be set, to check the first radio button with the given value represented by the object.</p>
    </dd></dl>
    <p>The object’s <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#dfn-supported-property-indices">supported property indices</a> are as defined for <code>HTMLCollection</code> objects.</p>
    <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL/#dfn-supported-property-names">supported property names</a> consist of the non-empty values of all the <code>id</code> and <code>name</code> attributes of all the elements <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#represented-by-the-collection">represented by the collection</a>, in <a data-link-type="dfn" href="infrastructure.html#tree-order" id="ref-for-tree-order-7">tree order</a>, ignoring later duplicates, with the <code>id</code> of an element preceding
  its <code>name</code> if it contributes both, they differ from each other, and neither is the
  duplicate of an earlier entry.</p>
    <p>The properties exposed in this way must be <a data-link-type="dfn" href="https://heycam.github.io/webidl/#LegacyUnenumerableNamedProperties">unenumerable</a>.</p>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="HTMLFormControlsCollection" data-dfn-type="method" data-export="" id="dom-htmlformcontrolscollection-nameditem"><code>namedItem(<var>name</var>)</code></dfn> method must act according to the
  following algorithm:</p>
    <ol>
     <li data-md="">
      <p>If <var>name</var> is the empty string, return null and stop the algorithm.</p>
     </li><li data-md="">
      <p>If, at the time the method is called, there is exactly one node in the collection that has
  either an <code>id</code> attribute or a <code>name</code> attribute equal to <var>name</var>, then return that node and stop the algorithm.</p>
     </li><li data-md="">
      <p>Otherwise, if there are no nodes in the collection that have either an <code>id</code> attribute or a <code>name</code> attribute equal to <var>name</var>, then return null and
  stop the algorithm.</p>
     </li><li data-md="">
      <p>Otherwise, create a new <code>RadioNodeList</code> object representing a <a data-link-type="dfn" href="infrastructure.html#live" id="ref-for-live-1">live</a> view of
  the <code>HTMLFormControlsCollection</code> object, further filtered so that the only nodes
  in the <code>RadioNodeList</code> object are those that have either an <code>id</code> attribute or a <code>name</code> attribute equal to <var>name</var>. The nodes in the <code>RadioNodeList</code> object must be sorted in <a data-link-type="dfn" href="infrastructure.html#tree-order" id="ref-for-tree-order-8">tree order</a>.</p>
     </li><li data-md="">
      <p>Return that <code>RadioNodeList</code> object.</p>
    </li></ol>
    <hr>
    <p>Members of the <code>RadioNodeList</code> interface inherited from the <code>NodeList</code> interface must behave as they would on a <code>NodeList</code> object.</p>
    <p>The <code class="idl"><a data-link-type="idl" href="infrastructure.html#dom-radionodelist-value" id="ref-for-dom-radionodelist-value-1">value</a></code> IDL attribute on the <code>RadioNodeList</code> object, on
  getting, must return the value returned by running the following steps:</p>
    <ol>
     <li data-md="">
      <p>Let <var>element</var> be the first element in <a data-link-type="dfn" href="infrastructure.html#tree-order" id="ref-for-tree-order-9">tree order</a> represented by the <code>RadioNodeList</code> object that is an <code><a data-link-type="element" href="sec-forms.html#elementdef-input" id="ref-for-elementdef-input-3">input</a></code> element whose <code>type</code> attribute is in the <a data-link-type="element-state" href="sec-forms.html#element-statedef-input-radio-button" id="ref-for-element-statedef-input-radio-button-1">Radio Button</a> state and whose <a data-link-type="dfn" href="sec-forms.html#forms-checkedness" id="ref-for-forms-checkedness-1">checkedness</a> is true. Otherwise, let it be null.</p>
     </li><li data-md="">
      <p>If <var>element</var> is null, return the empty string.</p>
     </li><li data-md="">
      <p>If <var>element</var> is an element with no <code>value</code> attribute, return the string
  "<code>on</code>".</p>
     </li><li data-md="">
      <p>Otherwise, return the value of <var>element</var>’s <code>value</code> attribute.</p>
    </li></ol>
    <p>On setting, the <code>value</code> IDL attribute must run the following steps:</p>
    <ol>
     <li data-md="">
      <p>If the new value is the string "<code>on</code>": let <var>element</var> be the first element
  in <a data-link-type="dfn" href="infrastructure.html#tree-order" id="ref-for-tree-order-10">tree order</a> represented by the <code>RadioNodeList</code> object that is an <code><a data-link-type="element" href="sec-forms.html#elementdef-input" id="ref-for-elementdef-input-4">input</a></code> element whose <code>type</code> attribute is in the <a data-link-type="element-state" href="sec-forms.html#element-statedef-input-radio-button" id="ref-for-element-statedef-input-radio-button-2">Radio Button</a> state and whose <code>value</code> content attribute is either absent, or present and equal
  to the new value, if any. If no such element exists, then instead let <var>element</var> be
  null.</p>
      <p>Otherwise: let <var>element</var> be the first element in <a data-link-type="dfn" href="infrastructure.html#tree-order" id="ref-for-tree-order-11">tree order</a> represented by the <code>RadioNodeList</code> object that is an <code><a data-link-type="element" href="sec-forms.html#elementdef-input" id="ref-for-elementdef-input-5">input</a></code> element
  whose <code>type</code> attribute is in the <a data-link-type="element-state" href="sec-forms.html#element-statedef-input-radio-button" id="ref-for-element-statedef-input-radio-button-3">Radio Button</a> state and whose <code>value</code> content attribute is present and equal to the new value, if any. If no
  such element exists, then instead let <var>element</var> be null.</p>
     </li><li data-md="">
      <p>If <var>element</var> is not null, then set its <a data-link-type="dfn" href="sec-forms.html#forms-checkedness" id="ref-for-forms-checkedness-2">checkedness</a> to true.</p>
    </li></ol>
    <h5 class="heading settled" data-level="2.7.2.3" id="the-htmloptionscollection-interface"><span class="secno">2.7.2.3. </span><span class="content">The <code>HTMLOptionsCollection</code> interface</span><a class="self-link" href="infrastructure.html#the-htmloptionscollection-interface"></a></h5>
    <p>The <code>HTMLOptionsCollection</code> interface is used for <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-collection">collections</a> of <code><a data-link-type="element" href="sec-forms.html#elementdef-option" id="ref-for-elementdef-option-1">option</a></code> elements. It is always rooted on a <code><a data-link-type="element" href="sec-forms.html#elementdef-select" id="ref-for-elementdef-select-3">select</a></code> element and has
  attributes and methods that manipulate that element’s descendants.</p>
<pre class="idl highlight def" data-highlight="webidl"><span class="kt">interface</span> <dfn class="nv dfn-paneled idl-code" data-dfn-for="HTMLOptionsCollection" data-dfn-type="interface" data-export="" id="htmloptionscollection-htmloptionscollection">HTMLOptionsCollection</dfn> : <a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/dom/#htmlcollection">HTMLCollection</a> {
  // inherits item(), namedItem()
  <span class="kt">attribute</span> <span class="kt">unsigned</span> <span class="kt">long</span> <a class="nv idl-code" data-link-type="attribute" data-type="unsigned long" href="infrastructure.html#dom-htmloptionscollection-length" id="ref-for-dom-htmloptionscollection-length-1">length</a>; // shadows inherited length
  <span class="kt">setter</span> <span class="kt">void</span> (<span class="kt">unsigned</span> <span class="kt">long</span> <dfn class="nv idl-code" data-dfn-for="HTMLOptionsCollection/__setter__(index, option)" data-dfn-type="argument" data-export="" id="dom-htmloptionscollection-__setter__-index-option-index">index<a class="self-link" href="infrastructure.html#dom-htmloptionscollection-__setter__-index-option-index"></a></dfn>, <a class="n" data-link-type="idl-name" href="sec-forms.html#htmloptionelement-htmloptionelement" id="ref-for-htmloptionelement-htmloptionelement-1">HTMLOptionElement</a>? <dfn class="nv idl-code" data-dfn-for="HTMLOptionsCollection/__setter__(index, option)" data-dfn-type="argument" data-export="" id="dom-htmloptionscollection-__setter__-index-option-option">option<a class="self-link" href="infrastructure.html#dom-htmloptionscollection-__setter__-index-option-option"></a></dfn>);
  <span class="kt">void</span> <a class="nv idl-code" data-link-type="method" href="infrastructure.html#dom-htmloptionscollection-add" id="ref-for-dom-htmloptionscollection-add-1">add</a>((<a class="n" data-link-type="idl-name" href="sec-forms.html#htmloptionelement-htmloptionelement" id="ref-for-htmloptionelement-htmloptionelement-2">HTMLOptionElement</a> <span class="kt">or</span> <a class="n" data-link-type="idl-name" href="sec-forms.html#htmloptgroupelement-htmloptgroupelement" id="ref-for-htmloptgroupelement-htmloptgroupelement-1">HTMLOptGroupElement</a>) <dfn class="nv idl-code" data-dfn-for="HTMLOptionsCollection/add(element, before), HTMLOptionsCollection/add(element)" data-dfn-type="argument" data-export="" id="dom-htmloptionscollection-add-element-before-element">element<a class="self-link" href="infrastructure.html#dom-htmloptionscollection-add-element-before-element"></a></dfn>, <span class="kt">optional</span> (<a class="n" data-link-type="idl-name" href="dom.html#htmlelement-htmlelement" id="ref-for-htmlelement-htmlelement-3">HTMLElement</a> <span class="kt">or</span> <span class="kt">long</span>)? <dfn class="nv idl-code" data-dfn-for="HTMLOptionsCollection/add(element, before), HTMLOptionsCollection/add(element)" data-dfn-type="argument" data-export="" id="dom-htmloptionscollection-add-element-before-before">before<a class="self-link" href="infrastructure.html#dom-htmloptionscollection-add-element-before-before"></a></dfn> = <span class="kt">null</span>);
  <span class="kt">void</span> <a class="nv idl-code" data-link-type="method" href="infrastructure.html#dom-htmloptionscollection-remove" id="ref-for-dom-htmloptionscollection-remove-1">remove</a>(<span class="kt">long</span> <dfn class="nv idl-code" data-dfn-for="HTMLOptionsCollection/remove(index)" data-dfn-type="argument" data-export="" id="dom-htmloptionscollection-remove-index-index">index<a class="self-link" href="infrastructure.html#dom-htmloptionscollection-remove-index-index"></a></dfn>);
  <span class="kt">attribute</span> <span class="kt">long</span> <a class="nv idl-code" data-link-type="attribute" data-type="long" href="infrastructure.html#dom-htmloptionscollection-selectedindex" id="ref-for-dom-htmloptionscollection-selectedindex-1">selectedIndex</a>;
};
</pre>
    <dl class="domintro">
     <dt><var>collection</var> . <code>length</code> [ = <var>value</var> ]
     </dt><dd>
       Returns the number of elements in the collection. 
      <p>When set to a smaller number, truncates the number of <code><a data-link-type="element" href="sec-forms.html#elementdef-option" id="ref-for-elementdef-option-2">option</a></code> elements in the
      corresponding container.</p>
      <p>When set to a greater number, adds new blank <code><a data-link-type="element" href="sec-forms.html#elementdef-option" id="ref-for-elementdef-option-3">option</a></code> elements to that container.</p>
     </dd><dt><var>element</var> = <var>collection</var> . <code>item</code>(<var>index</var>)
     </dt><dt><var>element</var> = <var>collection</var>[<var>index</var>]
     </dt><dd> Returns the item with index <var>index</var> from the collection. The items are sorted in <a data-link-type="dfn" href="infrastructure.html#tree-order" id="ref-for-tree-order-12">tree order</a>. 
     </dd><dt><var>collection</var>[<var>index</var>] = <var>element</var>
     </dt><dd>
       When <var>index</var> is a greater number than the number of items in the collection, adds
      new blank <code><a data-link-type="element" href="sec-forms.html#elementdef-option" id="ref-for-elementdef-option-4">option</a></code> elements in the corresponding container. 
      <p>When set to null, removes the item at index <var>index</var> from the collection.</p>
      <p>When set to an <code><a data-link-type="element" href="sec-forms.html#elementdef-option" id="ref-for-elementdef-option-5">option</a></code> element, adds or replaces it at index <var>index</var> from the collection.</p>
     </dd><dt><var>element</var> = <var>collection</var> . <code>namedItem</code>(<var>name</var>)
     </dt><dt><var>element</var> = <var>collection</var>[<var>name</var>]
     </dt><dd>
       Returns the item with <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-id">ID</a> or <code>name</code> <var>name</var> from the collection. 
      <p>If there are multiple matching items, then the first is returned.</p>
     </dd><dt><var>collection</var> . <code>add</code>(<var>element</var> [, <var>before</var> ] )
     </dt><dd>
       Inserts <var>element</var> before the node given by <var>before</var>. 
      <p>The <var>before</var> argument can be a number, in which case <var>element</var> is inserted
      before the item with that number, or an element from the collection, in which case <var>element</var> is inserted before that element.</p>
      <p>If <var>before</var> is omitted, null, or a number out of range, then <var>element</var> will
      be added at the end of the list.</p>
      <p>This method will throw a <code>HierarchyRequestError</code> exception if <var>element</var> is
      an ancestor of the element into which it is to be inserted.</p>
     </dd><dt><var>collection</var> . <code>remove</code>(<var>index</var>)
     </dt><dd>Removes the item with index <var>index</var> from the collection.
     </dd><dt><var>collection</var> . <code>selectedIndex</code> [ = <var>value</var> ]
     </dt><dd>
       Returns the index of the first selected item, if any, or -1 if there is no selected
      item. 
      <p>Can be set, to change the selection.</p>
    </dd></dl>
    <p>The object’s <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL-1/#dfn-supported-property-indices">supported property indices</a> are as defined for <code>HTMLCollection</code> objects.</p>
    <p>On getting, the <dfn class="dfn-paneled idl-code" data-dfn-for="HTMLOptionsCollection" data-dfn-type="attribute" data-export="" id="dom-htmloptionscollection-length"><code>length</code></dfn> attribute must return the number of nodes <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#represented-by-the-collection">represented by the collection</a>.</p>
    <p>On setting, the behavior depends on whether the new value is equal to, greater than, or less than
  the number of nodes <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#represented-by-the-collection">represented by the collection</a> at that time. If the number is the same,
  then setting the attribute must do nothing. If the new value is greater, then <var>n</var> new <code><a data-link-type="element" href="sec-forms.html#elementdef-option" id="ref-for-elementdef-option-6">option</a></code> elements with no attributes and no child nodes must be appended to the <code><a data-link-type="element" href="sec-forms.html#elementdef-select" id="ref-for-elementdef-select-4">select</a></code> element on which the <code>HTMLOptionsCollection</code> is rooted, where <var>n</var> is the difference between the two numbers (new value minus old value). Mutation
  events must be fired as if a <code>DocumentFragment</code> containing the new <code>option</code> elements had been inserted. If the new value is lower, then the last <var>n</var> nodes in the
  collection must be removed from their parent nodes, where <var>n</var> is the difference between
  the two numbers (old value minus new value).</p>
    <p class="note" role="note"> Setting <code>length</code> never removes or adds any <code><a data-link-type="element" href="sec-forms.html#elementdef-optgroup" id="ref-for-elementdef-optgroup-1">optgroup</a></code> elements, and never
    adds new children to existing <code><a data-link-type="element" href="sec-forms.html#elementdef-optgroup" id="ref-for-elementdef-optgroup-2">optgroup</a></code> elements (though it can remove children from
    them). </p>
    <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL/#dfn-supported-property-names">supported property names</a> consist of the non-empty values of all the <code>id</code> and <code>name</code> attributes of all the elements <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#represented-by-the-collection">represented by the collection</a>, in <a data-link-type="dfn" href="infrastructure.html#tree-order" id="ref-for-tree-order-13">tree order</a>, ignoring later duplicates, with the <code>id</code> of an element preceding its <code>name</code> if it contributes both, they differ from each other, and neither is the
  duplicate of an earlier entry.</p>
    <p>The properties exposed in this way must be <a data-link-type="dfn" href="https://heycam.github.io/webidl/#LegacyUnenumerableNamedProperties">unenumerable</a>.</p>
    <p>When the user agent is to <dfn data-dfn-type="dfn" data-lt="set the value of a new indexed property or set the value of an existing indexed property" data-noexport="" id="set-the-value-of-a-new-indexed-property-or-set-the-value-of-an-existing-indexed-property">set the value of a new indexed property or set the value of an
  existing indexed property<a class="self-link" href="infrastructure.html#set-the-value-of-a-new-indexed-property-or-set-the-value-of-an-existing-indexed-property"></a></dfn> for a given property index <var>index</var> to a new value <var>value</var>, it must run the following algorithm:</p>
    <ol>
     <li data-md="">
      <p>If <var>value</var> is null, invoke the steps for the <code>remove</code> method with <var>index</var> as the argument, and abort these steps.</p>
     </li><li data-md="">
      <p>Let <var>length</var> be the number of nodes <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#represented-by-the-collection">represented by the collection</a>.</p>
     </li><li data-md="">
      <p>Let <var>n</var> be <var>index</var> minus <var>length</var>.</p>
     </li><li data-md="">
      <p>If <var>n</var> is greater than zero, then <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-append">append</a> a <code>DocumentFragment</code> consisting of <var>n</var>-1 new <code><a data-link-type="element" href="sec-forms.html#elementdef-option" id="ref-for-elementdef-option-7">option</a></code> elements with no attributes and no
  child nodes to the <code><a data-link-type="element" href="sec-forms.html#elementdef-select" id="ref-for-elementdef-select-5">select</a></code> element on which the <code>HTMLOptionsCollection</code> is rooted.</p>
     </li><li data-md="">
      <p>If <var>n</var> is greater than or equal to zero, <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-append">append</a> <var>value</var> to the <code><a data-link-type="element" href="sec-forms.html#elementdef-select" id="ref-for-elementdef-select-6">select</a></code> element. Otherwise, <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-replace">replace</a> the <var>index</var>th element in the
  collection by <var>value</var>.</p>
    </li></ol>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="HTMLOptionsCollection" data-dfn-type="method" data-export="" data-lt="add(element, before)|add(element)" id="dom-htmloptionscollection-add"><code>add(<var>element</var>, <var>before</var>)</code></dfn> method must act according
  to the following algorithm:</p>
    <ol>
     <li data-md="">
      <p>If <var>element</var> is an ancestor of the <code><a data-link-type="element" href="sec-forms.html#elementdef-select" id="ref-for-elementdef-select-7">select</a></code> element on which the <code>HTMLOptionsCollection</code> is rooted, then throw a <code>HierarchyRequestError</code> exception and abort these steps.</p>
     </li><li data-md="">
      <p>If <var>before</var> is an element, but that element isn’t a descendant of the <code><a data-link-type="element" href="sec-forms.html#elementdef-select" id="ref-for-elementdef-select-8">select</a></code> element on which the <code>HTMLOptionsCollection</code> is rooted, then
  throw a <code>NotFoundError</code> exception and abort these steps.</p>
     </li><li data-md="">
      <p>If <var>element</var> and <var>before</var> are the same element, then return and abort these
  steps.</p>
     </li><li data-md="">
      <p>If <var>before</var> is a node, then let <var>reference</var> be that node. Otherwise, if <var>before</var> is an integer, and there is a <var>before</var>th node in the collection,
  let <var>reference</var> be that node. Otherwise, let <var>reference</var> be null.</p>
     </li><li data-md="">
      <p>If <var>reference</var> is not null, let <var>parent</var> be the parent node of <var>reference</var>. Otherwise, let <var>parent</var> be the <code><a data-link-type="element" href="sec-forms.html#elementdef-select" id="ref-for-elementdef-select-9">select</a></code> element on
  which the <code>HTMLOptionsCollection</code> is rooted.</p>
     </li><li data-md="">
      <p>Act as if the DOM <code>insertBefore()</code> method was invoked on the <var>parent</var> node,
  with <var>element</var> as the first argument and <var>reference</var> as the second argument.</p>
    </li></ol>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="HTMLOptionsCollection" data-dfn-type="method" data-export="" id="dom-htmloptionscollection-remove"><code>remove(<var>index</var>)</code></dfn> method must act according to the following
  algorithm:</p>
    <ol>
     <li data-md="">
      <p>If the number of nodes <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#represented-by-the-collection">represented by the collection</a> is zero, abort these steps.</p>
     </li><li data-md="">
      <p>If <var>index</var> is not a number greater than or equal to 0 and less than the number of
  nodes <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#represented-by-the-collection">represented by the collection</a>, abort these steps.</p>
     </li><li data-md="">
      <p>Let <var>element</var> be the <var>index</var>th element in the collection.</p>
     </li><li data-md="">
      <p>Remove <var>element</var> from its parent node.</p>
    </li></ol>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="HTMLOptionsCollection" data-dfn-type="attribute" data-export="" id="dom-htmloptionscollection-selectedindex"><code>selectedIndex</code></dfn> IDL attribute must act like the identically named
  attribute on the <code><a data-link-type="element" href="sec-forms.html#elementdef-select" id="ref-for-elementdef-select-10">select</a></code> element on which the <code>HTMLOptionsCollection</code> is
  rooted</p>
    <h4 class="heading settled" data-level="2.7.3" id="the-domstringmap-interface"><span class="secno">2.7.3. </span><span class="content">The <code>DOMStringMap</code> interface</span><a class="self-link" href="infrastructure.html#the-domstringmap-interface"></a></h4>
    <p>The <code>DOMStringMap</code> interface represents a set of name-value pairs. It exposes these
  using the scripting language’s native mechanisms for property access.</p>
    <p>When a <code>DOMStringMap</code> object is instantiated, it is associated with three algorithms,
  one for getting the list of name-value pairs, one for setting names to certain values, and one for
  deleting names.</p>
<pre class="idl highlight def" data-highlight="webidl">[<a class="nv idl-code" data-link-type="extended-attribute">OverrideBuiltins</a>]
<span class="kt">interface</span> <dfn class="nv dfn-paneled idl-code" data-dfn-for="DOMStringMap" data-dfn-type="interface" data-export="" id="domstringmap-domstringmap">DOMStringMap</dfn> {
  <span class="kt">getter</span> <span class="kt">DOMString</span> (<span class="kt">DOMString</span> <dfn class="nv idl-code" data-dfn-for="DOMStringMap/__getter__(name)" data-dfn-type="argument" data-export="" id="dom-domstringmap-__getter__-name-name">name<a class="self-link" href="infrastructure.html#dom-domstringmap-__getter__-name-name"></a></dfn>);
  <span class="kt">setter</span> <span class="kt">void</span> (<span class="kt">DOMString</span> <dfn class="nv idl-code" data-dfn-for="DOMStringMap/__setter__(name, value)" data-dfn-type="argument" data-export="" id="dom-domstringmap-__setter__-name-value-name">name<a class="self-link" href="infrastructure.html#dom-domstringmap-__setter__-name-value-name"></a></dfn>, <span class="kt">DOMString</span> <dfn class="nv idl-code" data-dfn-for="DOMStringMap/__setter__(name, value)" data-dfn-type="argument" data-export="" id="dom-domstringmap-__setter__-name-value-value">value<a class="self-link" href="infrastructure.html#dom-domstringmap-__setter__-name-value-value"></a></dfn>);
  <span class="kt">deleter</span> <span class="kt">void</span> (<span class="kt">DOMString</span> <dfn class="nv idl-code" data-dfn-for="DOMStringMap/__deleter__(name)" data-dfn-type="argument" data-export="" id="dom-domstringmap-__deleter__-name-name">name<a class="self-link" href="infrastructure.html#dom-domstringmap-__deleter__-name-name"></a></dfn>);
};
</pre>
    <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL/#dfn-supported-property-names">supported property names</a> on a <code>DOMStringMap</code> object at any instant are the
  names of each pair returned from the algorithm for getting the list of name-value pairs at that
  instant, in the order returned.</p>
    <p>To <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL/#dfn-determine-the-value-of-a-named-property">determine the value of a named property</a> <var>name</var> in a <code class="idl"><a data-link-type="idl" href="infrastructure.html#domstringmap-domstringmap" id="ref-for-domstringmap-domstringmap-1">DOMStringMap</a></code>, the user agent must return the value component of the name-value pair
  whose name component is <var>name</var> in the list returned by the algorithm for getting the list
  of name-value pairs.</p>
    <p>To <a data-link-type="dfn" href="infrastructure.html#values-setting" id="ref-for-values-setting-1">set</a> the value of a named property <var>name</var> to value <var>value</var>, the
  algorithm for setting names to certain values must be run, passing <var>name</var> as the name and <var>value</var> as the value.</p>
    <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="delete-an-existing-named-property">delete an existing named property</dfn> <var>name</var>, the algorithm for deleting names
  must be run, passing <var>name</var> as the name.</p>
    <p class="note" role="note"> The <code>DOMStringMap</code> interface definition here is only intended for JavaScript
    environments. Other language bindings will need to define how <code>DOMStringMap</code> is to be
    implemented for those languages. </p>
    <div class="example" id="example-e1e84d85">
     <a class="self-link" href="infrastructure.html#example-e1e84d85"></a> The <code>dataset</code> attribute on elements exposes the <code>data-*</code> attributes on the
  element. 
     <p>Given the following fragment and elements with similar constructions:</p>
<pre class="highlight"><span class="nt">&lt;img</span> <span class="na">class=</span><span class="s">"tower"</span> <span class="na">id=</span><span class="s">"tower5"</span> <span class="na">data-x=</span><span class="s">"12"</span> <span class="na">data-y=</span><span class="s">"5"</span> <span class="na">data-ai=</span><span class="s">"robotarget"</span> <span class="na">data-hp=</span><span class="s">"46"</span> <span class="na">data-ability=</span><span class="s">"flames"</span> <span class="na">src=</span><span class="s">"towers/rocket.png"</span> <span class="na">alt=</span><span class="s">"Rocket Tower"</span><span class="nt">&gt;</span>
</pre>
     <p>...one could imagine a function <code>splashDamage()</code> that takes some arguments, the first
  of which is the element to process:</p>
<pre class="highlight"><span class="kd">function</span> <span class="nx">splashDamage</span><span class="p">(</span><span class="nx">node</span><span class="p">,</span> <span class="nx">x</span><span class="p">,</span> <span class="nx">y</span><span class="p">,</span> <span class="nx">damage</span><span class="p">)</span> <span class="p">{</span>
  <span class="k">if</span> <span class="p">(</span><span class="nx">node</span><span class="p">.</span><span class="nx">classList</span><span class="p">.</span><span class="nx">contains</span><span class="p">(</span><span class="s1">'tower'</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="c1">// checking the 'class' attribute</span>
      <span class="nx">node</span><span class="p">.</span><span class="nx">dataset</span><span class="p">.</span><span class="nx">x</span> <span class="o">==</span> <span class="nx">x</span> <span class="o">&amp;&amp;</span> <span class="c1">// reading the 'data-x' attribute</span>
      <span class="nx">node</span><span class="p">.</span><span class="nx">dataset</span><span class="p">.</span><span class="nx">y</span> <span class="o">==</span> <span class="nx">y</span><span class="p">)</span> <span class="p">{</span> <span class="c1">// reading the 'data-y' attribute</span>
    <span class="kd">var</span> <span class="nx">hp</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">node</span><span class="p">.</span><span class="nx">dataset</span><span class="p">.</span><span class="nx">hp</span><span class="p">);</span> <span class="c1">// reading the 'data-hp' attribute</span>
    <span class="nx">hp</span> <span class="o">=</span> <span class="nx">hp</span> <span class="o">-</span> <span class="nx">damage</span><span class="p">;</span>
    <span class="k">if</span> <span class="p">(</span><span class="nx">hp</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
      <span class="nx">hp</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
      <span class="nx">node</span><span class="p">.</span><span class="nx">dataset</span><span class="p">.</span><span class="nx">ai</span> <span class="o">=</span> <span class="s1">'dead'</span><span class="p">;</span> <span class="c1">// setting the 'data-ai' attribute</span>
      <span class="k">delete</span> <span class="nx">node</span><span class="p">.</span><span class="nx">dataset</span><span class="p">.</span><span class="nx">ability</span><span class="p">;</span> <span class="c1">// removing the 'data-ability' attribute</span>
    <span class="p">}</span>
    <span class="nx">node</span><span class="p">.</span><span class="nx">dataset</span><span class="p">.</span><span class="nx">hp</span> <span class="o">=</span> <span class="nx">hp</span><span class="p">;</span> <span class="c1">// setting the 'data-hp' attribute</span>
  <span class="p">}</span>
<span class="p">}</span>
</pre>
    </div>
    <h4 class="heading settled" data-level="2.7.4" id="the-domelementmap-interface"><span class="secno">2.7.4. </span><span class="content">The <code>DOMElementMap</code> interface</span><a class="self-link" href="infrastructure.html#the-domelementmap-interface"></a></h4>
    <p>The <code>DOMElementMap</code> interface represents a set of name-element mappings. It exposes
  these using the scripting language’s native mechanisms for property access.</p>
    <p>When a <code>DOMElementMap</code> object is instantiated, it is associated with three algorithms,
  one for getting the list of name-element mappings, one for mapping a name to a certain element,
  and one for deleting mappings by name.</p>
<pre class="idl highlight def" data-highlight="webidl"><span class="kt">interface</span> <dfn class="nv idl-code" data-dfn-for="DOMElementMap" data-dfn-type="interface" data-export="" id="domelementmap-domelementmap">DOMElementMap<a class="self-link" href="infrastructure.html#domelementmap-domelementmap"></a></dfn> {
  <span class="kt">getter</span> <a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/dom/#interface-element">Element</a> (<span class="kt">DOMString</span> <dfn class="nv idl-code" data-dfn-for="DOMElementMap/__getter__(name)" data-dfn-type="argument" data-export="" id="dom-domelementmap-__getter__-name-name">name<a class="self-link" href="infrastructure.html#dom-domelementmap-__getter__-name-name"></a></dfn>);
  <span class="kt">setter</span> <span class="kt">creator</span> <span class="kt">void</span> (<span class="kt">DOMString</span> <dfn class="nv idl-code" data-dfn-for="DOMElementMap/__setter__(name, value)" data-dfn-type="argument" data-export="" id="dom-domelementmap-__setter__-name-value-name">name<a class="self-link" href="infrastructure.html#dom-domelementmap-__setter__-name-value-name"></a></dfn>, <a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/dom/#interface-element">Element</a> <dfn class="nv idl-code" data-dfn-for="DOMElementMap/__setter__(name, value)" data-dfn-type="argument" data-export="" id="dom-domelementmap-__setter__-name-value-value">value<a class="self-link" href="infrastructure.html#dom-domelementmap-__setter__-name-value-value"></a></dfn>);
  <span class="kt">deleter</span> <span class="kt">void</span> (<span class="kt">DOMString</span> <dfn class="nv idl-code" data-dfn-for="DOMElementMap/__deleter__(name)" data-dfn-type="argument" data-export="" id="dom-domelementmap-__deleter__-name-name">name<a class="self-link" href="infrastructure.html#dom-domelementmap-__deleter__-name-name"></a></dfn>);
};
</pre>
    <p>The <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL/#dfn-supported-property-names">supported property names</a> on a <code>DOMElementMap</code> object at any instant are the
  names for each mapping returned from the algorithm for getting the list of name-element mappings
  at that instant, in the order returned.</p>
    <p>To <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL/#dfn-determine-the-value-of-a-named-property">determine the value of a named property</a> <var>name</var> in a <code>DOMElementMap</code>, the user agent must return the element component of the name-element
  mapping whose name component is <var>name</var> in the list returned by the algorithm for getting
  the list of name-element mappings.</p>
    <p>To set the value of a <dfn data-dfn-type="dfn" data-noexport="" id="new">new<a class="self-link" href="infrastructure.html#new"></a></dfn> or <dfn data-dfn-type="dfn" data-noexport="" id="existing">existing<a class="self-link" href="infrastructure.html#existing"></a></dfn> named property <var>name</var> to
  value <var>value</var>, the algorithm for mapping a name to a certain element must be run, passing <var>name</var> as the name <var>value</var> as the element.</p>
    <p>To <a data-link-type="dfn" href="infrastructure.html#delete-an-existing-named-property" id="ref-for-delete-an-existing-named-property-1">delete an existing named property</a> <var>name</var>, the algorithm for deleting
  mappings must be run, passing <var>name</var> as the name component of the mapping to be deleted.</p>
    <p class="note" role="note"> The <code>DOMElementMap</code> interface definition here is only intended for JavaScript
    environments. Other language bindings will need to define how <code>DOMElementMap</code> is to
    be implemented for those languages. </p>
    <h4 class="heading settled" data-level="2.7.5" id="garbage-collection"><span class="secno">2.7.5. </span><span class="content">Garbage collection</span><a class="self-link" href="infrastructure.html#garbage-collection"></a></h4>
    <p>There is an <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="implied-strong-reference">implied strong reference</dfn> from any IDL attribute that returns a pre-existing
  object to that object.</p>
    <div class="example" id="example-b96658ed"><a class="self-link" href="infrastructure.html#example-b96658ed"></a> For example, the <code>window.document</code> attribute on the <code class="idl"><a data-link-type="idl" href="browsers.html#window-window" id="ref-for-window-window-2">Window</a></code> object means that there is a strong reference
    from a <code class="idl"><a data-link-type="idl" href="browsers.html#window-window" id="ref-for-window-window-3">Window</a></code> object to its <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> object. Similarly, there is
    always a strong reference from a <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> to any descendant nodes, and from any
    node to its owner <a data-link-type="dfn" href="https://www.w3.org/TR/dom/#concept-node-document">node document</a>. </div>
    <h3 class="heading settled" data-level="2.8" id="namespaces"><span class="secno">2.8. </span><span class="content">Namespaces</span><a class="self-link" href="infrastructure.html#namespaces"></a></h3>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="html-namespace">HTML namespace</dfn> is: <code>http://www.w3.org/1999/xhtml</code></p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="mathml-namespace">MathML namespace</dfn> is: <code>http://www.w3.org/1998/Math/MathML</code></p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="svg-namespace">SVG namespace</dfn> is: <code>http://www.w3.org/2000/svg</code></p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="xlink-namespace">XLink namespace</dfn> is: <code>http://www.w3.org/1999/xlink</code></p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="xml-namespace">XML namespace</dfn> is: <code>http://www.w3.org/XML/1998/namespace</code></p>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="xmlns-namespace">XMLNS namespace</dfn> is: <code>http://www.w3.org/2000/xmlns/</code></p>
    <hr>
    <p>Data mining tools and other user agents that perform operations on content without running
  scripts, evaluating CSS or XPath expressions, or otherwise exposing the resulting DOM to arbitrary
  content, may "support namespaces" by just asserting that their DOM node analogs are in certain
  namespaces, without actually exposing the above strings.</p>
    <hr>
    <p class="note" role="note"> In <a href="syntax.html#syntax">the HTML syntax</a>, namespace prefixes and namespace declarations do not have the same
    effect as in XML. For instance, the colon has no special meaning in HTML element names. </p>
    <h3 class="heading settled" data-level="2.9" id="safe-passing-of-structured-data"><span class="secno">2.9. </span><span class="content">Safe passing of structured data</span><a class="self-link" href="infrastructure.html#safe-passing-of-structured-data"></a></h3>
    <p>This section uses the terminology and typographic conventions from the JavaScript specification. <a data-link-type="biblio" href="references.html#biblio-ecma-262">[ECMA-262]</a></p>
    <h4 class="heading settled" data-level="2.9.1" id="section-cloneable-objects"><span class="secno">2.9.1. </span><span class="content"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="cloneable-objects">Cloneable objects</dfn></span><a class="self-link" href="infrastructure.html#section-cloneable-objects"></a></h4>
    <p><a data-link-type="dfn" href="infrastructure.html#cloneable-objects" id="ref-for-cloneable-objects-1">Cloneable objects</a> support being cloned across <a data-link-type="dfn" href="webappapis.html#event-loop" id="ref-for-event-loop-3">event loops</a>. That is, they support
  being cloned across <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code> and <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/workers/#worker">Worker</a></code> boundaries, including across <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/dom/#document">Document</a></code>s of
  different <a data-link-type="dfn" href="browsers.html#concept-cross-origin" id="ref-for-concept-cross-origin-2">origins</a>. Not all objects are <a data-link-type="dfn" href="infrastructure.html#cloneable-objects" id="ref-for-cloneable-objects-2">cloneable objects</a> and not all
  aspects of objects that are <a data-link-type="dfn" href="infrastructure.html#cloneable-objects" id="ref-for-cloneable-objects-3">cloneable objects</a> are necessarily preserved when cloned.</p>
    <p><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-platform-object">Platform objects</a> have the following internal method:</p>
    <p>[[<dfn class="dfn-paneled" data-dfn-for="structured" data-dfn-type="dfn" data-noexport="" id="structured-clone">Clone</dfn>]] ( <var>targetRealm</var>, <var>memory</var> )</p>
    <p>Unless specified otherwise, invoking the [[<a data-link-type="dfn" href="infrastructure.html#structured-clone" id="ref-for-structured-clone-1">Clone</a>]] internal method must
  throw a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#datacloneerror">DataCloneError</a></code>" <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/WebIDL-1/#idl-DOMException">DOMException</a></code>. (By default, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-platform-object">platform objects</a> are not <a data-link-type="dfn" href="infrastructure.html#cloneable-objects" id="ref-for-cloneable-objects-4">cloneable objects</a>.)</p>
    <p><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-platform-object">Platform objects</a> that are <a data-link-type="dfn" href="infrastructure.html#cloneable-objects" id="ref-for-cloneable-objects-5">cloneable objects</a> have a [[<a data-link-type="dfn" href="infrastructure.html#structured-clone" id="ref-for-structured-clone-2">Clone</a>]]
  internal method which is specified to run a series of steps. The result of running those steps
  must be a thrown exception or a clone of <em>this</em>, created in <var>targetRealm</var>. It is
  up such objects to define what cloning means for them.</p>
    <p>Objects defined in the JavaScript specification are handled by the <a data-link-type="dfn" href="infrastructure.html#structuredclone" id="ref-for-structuredclone-1">StructuredClone</a> abstract
  operation directly.</p>
    <h4 class="heading settled" data-level="2.9.2" id="section-transferable-objects"><span class="secno">2.9.2. </span><span class="content"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="transferable-objects">Transferable objects</dfn></span><a class="self-link" href="infrastructure.html#section-transferable-objects"></a></h4>
    <p><a data-link-type="dfn" href="infrastructure.html#transferable-objects" id="ref-for-transferable-objects-1">Transferable objects</a> support being transferred across <a data-link-type="dfn" href="webappapis.html#event-loop" id="ref-for-event-loop-4">event loops</a>. Transferring is
  effectively recreating the object while sharing a reference to the underlying data and then
  detaching the object being transferred. This is useful to transfer ownership of expensive
  resources. Not all objects are <a data-link-type="dfn" href="infrastructure.html#transferable-objects" id="ref-for-transferable-objects-2">transferable objects</a> and not all aspects of objects that are <a data-link-type="dfn" href="infrastructure.html#transferable-objects" id="ref-for-transferable-objects-3">transferable objects</a> are necessarily preserved when transferred.</p>
    <p class="note" role="note">Transferring is an irreversible and non-idempotent operation. Once an object has
  been transferred, it cannot be transferred, or indeed used, again.</p>
    <p><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-platform-object">Platform objects</a> that are <a data-link-type="dfn" href="infrastructure.html#transferable-objects" id="ref-for-transferable-objects-4">transferable objects</a> have a [[<dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="detached">Detached</dfn>]]
  internal slot and the following internal method:</p>
    <p>[[<dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="transfer">Transfer</dfn>]] ( <var>targetRealm</var> )</p>
    <p class="note" role="note">Whereas all <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-platform-object">platform objects</a> have a [[<a data-link-type="dfn" href="infrastructure.html#structured-clone" id="ref-for-structured-clone-3">Clone</a>]]
  internal method, not all have a [[<a data-link-type="dfn" href="infrastructure.html#detached" id="ref-for-detached-1">Detached</a>]] internal slot and a [[<a data-link-type="dfn" href="infrastructure.html#transfer" id="ref-for-transfer-1">Transfer</a>]]
  internal method.</p>
    <p><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-platform-object">Platform objects</a> that are <a data-link-type="dfn" href="infrastructure.html#transferable-objects" id="ref-for-transferable-objects-5">transferable objects</a> must define the [[<a data-link-type="dfn" href="infrastructure.html#transfer" id="ref-for-transfer-2">Transfer</a>]]
  internal method such that it either throws an exception or returns a clone of <em>this</em>,
  created in <var>targetRealm</var>, with <em>this</em>’s underlying data shared with the return
  value, and <em>this</em>’s [[<a data-link-type="dfn" href="infrastructure.html#detached" id="ref-for-detached-2">Detached</a>]] internal slot value set to true. It is up to such
  objects to define what transfering means for them.</p>
    <p>Objects defined in the JavaScript specification are handled by the <a data-link-type="dfn" href="infrastructure.html#structuredclonewithtransfer" id="ref-for-structuredclonewithtransfer-1">StructuredCloneWithTransfer</a> abstract operation directly. (Technically, by <a data-link-type="dfn" href="infrastructure.html#istransferable" id="ref-for-istransferable-1">IsTransferable</a> and <a data-link-type="dfn" href="infrastructure.html#transferhelper" id="ref-for-transferhelper-1">TransferHelper</a>.)</p>
    <h4 class="heading settled" data-level="2.9.3" id="section-structuredclonewithtransfer"><span class="secno">2.9.3. </span><span class="content"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="structuredclonewithtransfer">StructuredCloneWithTransfer</dfn> ( <var>input</var>, <var>transferList</var>, <var>targetRealm</var> )</span><a class="self-link" href="infrastructure.html#section-structuredclonewithtransfer"></a></h4>
    <ol>
     <li data-md="">
      <p>Let <var>memory</var> be an empty map.</p>
      <p class="note" role="note">The purpose of the memory map, both here and in the <a data-link-type="dfn" href="infrastructure.html#structuredclone" id="ref-for-structuredclone-2">StructuredClone</a> abstract operation, is to avoid cloning objects twice. This ends up preserving cycles and the
  identity of duplicate objects in graphs.</p>
     </li><li data-md="">
      <p>For each object <var>transferable</var> in <var>transferList</var>:</p>
      <ol>
       <li data-md="">
        <p>If <a data-link-type="dfn" href="infrastructure.html#istransferable" id="ref-for-istransferable-2">IsTransferable</a>(<var>transferable</var>) is false, then throw a
  "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#datacloneerror">DataCloneError</a></code>" <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/WebIDL-1/#idl-DOMException">DOMException</a></code>.</p>
       </li><li data-md="">
        <p>Let <var>placeholder</var> be a user-agent-defined placeholder object.</p>
       </li><li data-md="">
        <p>Create an entry in <var>memory</var> with key <var>transferable</var> and value <var>placeholder</var>.</p>
      </li></ol>
     </li><li data-md="">
      <p>Let <var>clone</var> be the result of ? <a data-link-type="dfn" href="infrastructure.html#structuredclone" id="ref-for-structuredclone-3">StructuredClone</a>(<var>input</var>, <var>targetRealm</var>, <var>memory</var>).</p>
     </li><li data-md="">
      <p>Let <var>outputTransferList</var> be a new empty <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">List</a>.</p>
     </li><li data-md="">
      <p>For each object <var>transferable</var> in <var>transferList</var>:</p>
      <ol>
       <li data-md="">
        <p>Let <var>placeholderResult</var> be the value of the entry in <var>memory</var> whose key
  is <var>transferable</var>.</p>
       </li><li data-md="">
        <p>Let <var>transferResult</var> be ? <a data-link-type="dfn" href="infrastructure.html#transferhelper" id="ref-for-transferhelper-2">TransferHelper</a>(<var>transferable</var>, <var>targetRealm</var>).</p>
       </li><li data-md="">
        <p>Within <var>clone</var>, replace references to <var>placeholderResult</var> with <var>transferResult</var>, such that everything holding a reference to <var>placeholderResult</var>, now holds a reference to <var>transferResult</var>.</p>
        <p class="note" role="note">This is a rather unusual low-level operation for which no primitives are defined by JavaScript.</p>
       </li><li data-md="">
        <p>Add <var>transferResult</var> as the last element of <var>outputTransferList</var>.</p>
      </li></ol>
     </li><li data-md="">
      <p>Return { [[Clone]]: <var>clone</var>, [[<var>transferList</var>]]: <var>outputTransferList</var> }.</p>
    </li></ol>
    <p class="note" role="note">Originally the <a data-link-type="dfn" href="infrastructure.html#structuredclonewithtransfer" id="ref-for-structuredclonewithtransfer-2">StructuredCloneWithTransfer</a> abstract operation was known as
  the "structured clone" algorithm. The <a data-link-type="dfn" href="infrastructure.html#structuredclone" id="ref-for-structuredclone-4">StructuredClone</a> abstract operation was known as the
  "internal structured clone" algorithm. Transferring objects, now handled by the <a data-link-type="dfn" href="infrastructure.html#structuredclonewithtransfer" id="ref-for-structuredclonewithtransfer-3">StructuredCloneWithTransfer</a> abstract operation, were formerly handled by parts of the
  algorithm of the <code>postMessage()</code> method on the <code class="idl"><a data-link-type="idl" href="browsers.html#window-window" id="ref-for-window-window-4">Window</a></code> object and the <code>Window/postMessage()</code> method on the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/webmessaging/#messageport">MessagePort</a></code> object.</p>
    <h4 class="heading settled" data-level="2.9.4" id="section-structuredclone"><span class="secno">2.9.4. </span><span class="content"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="structuredclone">StructuredClone</dfn> ( <var>input</var>, <var>targetRealm</var> [ , <var>memory</var> ] )</span><a class="self-link" href="infrastructure.html#section-structuredclone"></a></h4>
    <ol>
     <li data-md="">
      <p>If <var>memory</var> was not supplied, let <var>memory</var> be an empty map.</p>
     </li><li data-md="">
      <p>If <var>memory</var> contains an entry with key <var>input</var>, then return that entry’s
  value.</p>
     </li><li data-md="">
      <p>If <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a>(<var>input</var>) is Undefined, Null, Boolean, String, or Number, then return <var>input</var>.</p>
     </li><li data-md="">
      <p>If <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a>(<var>input</var>) is Symbol, then throw a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#datacloneerror">DataCloneError</a></code>" <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/WebIDL-1/#idl-DOMException">DOMException</a></code>.</p>
     </li><li data-md="">
      <p>Let <var>deepClone</var> be false.</p>
     </li><li data-md="">
      <p>If <var>input</var> has a [[BooleanData]] internal slot, then let <var>output</var> be a new
  Boolean object in <var>targetRealm</var> whose [[BooleanData]] internal slot value is the
  [[BooleanData]] internal slot value of <var>input</var>.</p>
     </li><li data-md="">
      <p>Otherwise, if <var>input</var> has a [[NumberData]] internal slot, then let <var>output</var> be a new Number object in <var>targetRealm</var> whose [NumberData]] internal slot value is
  the [[NumberData]] internal slot value of <var>input</var>.</p>
     </li><li data-md="">
      <p>Otherwise, if <var>input</var> has a [[StringData]] internal slot, then let <var>output</var> be a new String object in <var>targetRealm</var> whose [[StringData]] internal slot value is
  the [[StringData]] internal slot value of <var>input</var>.</p>
     </li><li data-md="">
      <p>Otherwise, if <var>input</var> has a [[DateValue]] internal slot, then let <var>output</var> be a new Date object in <var>targetRealm</var> whose [[DateValue]] internal slot value is the
  [[DateValue]] internal slot value of <var>input</var>.</p>
     </li><li data-md="">
      <p>Otherwise, if <var>input</var> has a [[RegExpMatcher]] internal slot, then let <var>output</var> be a new RegExp object in <var>targetRealm</var> whose [[RegExpMatcher]]
  internal slot value is the [[RegExpMatcher]] internal slot value of <var>input</var>, whose
  [[OriginalSource]] internal slot value is the [[OriginalSource]] internal slot value of <var>input</var>, and whose whose [[OriginalFlags]] internal slot value is the
  [[OriginalFlags]] internal slot value of <var>input</var>.</p>
     </li><li data-md="">
      <p>Otherwise, if <var>input</var> has an [[ArrayBufferData]] internal slot, then:</p>
      <ol>
       <li data-md="">
        <p>If <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-isdetachedbuffer">IsDetachedBuffer</a>(<var>input</var>) is true, then throw a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#datacloneerror">DataCloneError</a></code>" <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/WebIDL-1/#idl-DOMException">DOMException</a></code>.</p>
       </li><li data-md="">
        <p>Let <var>outputArrayBuffer</var> be the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor">%ArrayBuffer%</a> intrinsic object in <var>targetRealm</var>.</p>
       </li><li data-md="">
        <p>Let <var>output</var> be ? <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-clonearraybuffer">CloneArrayBuffer</a>(<var>input</var>, 0, <var>outputArrayBuffer</var>).</p>
      </li></ol>
     </li><li data-md="">
      <p>Otherwise, if <var>input</var> has a [[ViewedArrayBuffer]] internal slot, then:</p>
      <ol>
       <li data-md="">
        <p>Let <var>buffer</var> be the value of <var>input</var>’s [[ViewedArrayBuffer]] internal
   slot.</p>
       </li><li data-md="">
        <p>Let <var>bufferClone</var> be ? <a data-link-type="dfn" href="infrastructure.html#structuredclone" id="ref-for-structuredclone-5">StructuredClone</a>(<var>buffer</var>, <var>targetRealm</var>, <var>memory</var>)}}.</p>
       </li><li data-md="">
        <p>If <var>input</var> has a [[DataView]] internal slot, then let <var>output</var> be a
   new DataView object in <var>targetRealm</var> whose [[DataView]] internal slot value is
   true, whose [[ViewedArrayBuffer]] internal slot value is <var>bufferClone</var>, whose
   [[ByteLength]] internal slot value is the [[ByteLength]] internal slot value of <var>input</var>, and whose [[ByteOffset]] internal slot value is the [[ByteOffset]]
   internal slot value of <var>input</var>.</p>
       </li><li data-md="">
        <p>Otherwise:</p>
        <ol>
         <li data-md="">
          <p>Assert: <var>input</var> has a [[TypedArrayName]] internal slot.</p>
         </li><li data-md="">
          <p>Let <var>constructor</var> be the intrinsic object listed in column one of <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#table-49">The TypedArray Constructors</a> table for the value of <var>input</var>’s [[TypedArrayName]] internal slot in <var>targetRealm</var>.</p>
         </li><li data-md="">
          <p>Let <var>byteOffset</var> be <var>input</var>’s [[ByteOffset]] internal slot value.</p>
         </li><li data-md="">
          <p>Let <var>length</var> be <var>input</var>’s [[ArrayLength]] internal slot value.</p>
         </li><li data-md="">
          <p>Let <var>output</var> be ? <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#typedarray-create">TypedArrayCreate</a>(<var>constructor</var>,
   « <var>bufferClone</var>, <var>byteOffset</var>, <var>length</var> »).</p>
        </li></ol>
      </li></ol>
     </li><li data-md="">
      <p>Otherwise, if <var>input</var> has [[MapData]] internal slot, then:</p>
      <ol>
       <li data-md="">
        <p>Let <var>output</var> be a new Map object in <var>targetRealm</var> whose [[MapData]]
   internal slot value is a new empty <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">List</a>.</p>
       </li><li data-md="">
        <p>Set <var>deepClone</var> to true.</p>
      </li></ol>
     </li><li data-md="">
      <p>Otherwise, if <var>input</var> has [[SetData]] internal slot, then:</p>
      <ol>
       <li data-md="">
        <p>Let <var>output</var> be a new Set object in <var>targetRealm</var> whose [[SetData]]
   internal slot value is a new empty <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">List</a>.</p>
       </li><li data-md="">
        <p>Set <var>deepClone</var> to true.</p>
      </li></ol>
     </li><li data-md="">
      <p>Otherwise, if <var>input</var> is an Array exotic object, then:</p>
      <ol>
       <li data-md="">
        <p>Let <var>inputLen</var> be <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ordinarygetownproperty">OrdinaryGetOwnProperty</a>(<var>input</var>,
   "<code>length</code>").[[value]].</p>
       </li><li data-md="">
        <p>Let <var>outputProto</var> be the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-properties-of-the-array-prototype-object">%ArrayPrototype%</a> intrinsic object in <var>targetRealm</var>.</p>
       </li><li data-md="">
        <p>Let <var>output</var> be ! <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-arraycreate">ArrayCreate</a>(<var>inputLen</var>, <var>outputProto</var>).</p>
       </li><li data-md="">
        <p>Set <var>deepClone</var> to true.</p>
      </li></ol>
     </li><li data-md="">
      <p>Otherwise, if <var>input</var> has a [[<a data-link-type="dfn" href="infrastructure.html#structured-clone" id="ref-for-structured-clone-4">Clone</a>]] internal method, then
   let <var>output</var> be ? <var>input</var>.[[<a data-link-type="dfn" href="infrastructure.html#structured-clone" id="ref-for-structured-clone-5">Clone</a>]](<var>targetRealm</var>, <var>memory</var>).</p>
     </li><li data-md="">
      <p>Otherwise, if <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-iscallable">IsCallable</a>(<var>input</var>)}} is true, then throw a
   "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#datacloneerror">DataCloneError</a></code>" <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/WebIDL-1/#idl-DOMException">DOMException</a></code>.</p>
     </li><li data-md="">
      <p>Otherwise, if <var>input</var> has any internal slot other than [[Prototype]] or
   [[Extensible]], then throw a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#datacloneerror">DataCloneError</a></code>" <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/WebIDL-1/#idl-DOMException">DOMException</a></code>.</p>
      <p class="example" id="example-37384063"><a class="self-link" href="infrastructure.html#example-37384063"></a>For instance, a [[PromiseState]] or [[WeakMapData]] internal slot.</p>
     </li><li data-md="">
      <p>Otherwise, if <var>input</var> is an exotic object, then throw a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#datacloneerror">DataCloneError</a></code>" <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/WebIDL-1/#idl-DOMException">DOMException</a></code>.</p>
      <p class="example" id="example-03903329"><a class="self-link" href="infrastructure.html#example-03903329"></a>For instance, a proxy object.</p>
     </li><li data-md="">
      <p>Otherwise:</p>
      <ol>
       <li data-md="">
        <p>Let <var>output</var> be a new Object in <var>targetRealm</var>.</p>
       </li><li data-md="">
        <p>Set <var>deepClone</var> to true.</p>
      </li></ol>
     </li><li data-md="">
      <p>Create an entry in <var>memory</var> whose key is <var>input</var> and value is <var>output</var>.</p>
     </li><li data-md="">
      <p>If <var>deepClone</var> is true, then:</p>
      <ol>
       <li data-md="">
        <p>If <var>input</var> has a [[MapData]] internal slot, then:</p>
        <ol>
         <li data-md="">
          <p>Let <var>inputList</var> the value of <var>input</var>’s [[MapData]] internal slot.</p>
         </li><li data-md="">
          <p>Let <var>copiedList</var> be a new empty <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">List</a>.</p>
         </li><li data-md="">
          <p>Repeat for each <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">Record</a> { [[key]], [[value]] } <var>entry</var> that is an
   element of <var>inputList</var>,</p>
          <ol>
           <li data-md="">
            <p>Let <var>copiedEntry</var> be a new <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">Record</a> { [[key]]: <var>entry</var>.[[key]], [[value]]: <var>entry</var>.[[value]] }.</p>
           </li><li data-md="">
            <p>If <var>copiedEntry</var>.[[key]] is not empty, append <var>copiedEntry</var> as
   the last element of <var>copiedList</var>.</p>
          </li></ol>
         </li><li data-md="">
          <p>Let <var>outputList</var> be the value of <var>output</var>’s [[MapData]] internal
   slot.</p>
         </li><li data-md="">
          <p>For each <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">Record</a> { [[key]], [[value]] } <var>entry</var> that is an element of <var>copiedList</var>,</p>
          <ol>
           <li data-md="">
            <p>Let <var>outputKey</var> be ? <a data-link-type="dfn" href="infrastructure.html#structuredclone" id="ref-for-structuredclone-6">StructuredClone</a>(<var>entry</var>.[[key]], <var>targetRealm</var>, <var>memory</var>).</p>
           </li><li data-md="">
            <p>Let <var>outputValue</var> be ? <a data-link-type="dfn" href="infrastructure.html#structuredclone" id="ref-for-structuredclone-7">StructuredClone</a>(<var>entry</var>.[[value]], <var>targetRealm</var>, <var>memory</var>).</p>
           </li><li data-md="">
            <p>Add { [[key]]: <var>outputKey</var>, [[value]]: <var>outputValue</var> } as the
   last element of <var>outputList</var>.</p>
          </li></ol>
        </li></ol>
       </li><li data-md="">
        <p>Otherwise, if <var>input</var> has a [[SetData]] internal slot, then:</p>
        <ol>
         <li data-md="">
          <p>Let <var>copiedList</var> be a copy of the value of <var>input</var>’s [[SetData]]
   internal slot.</p>
         </li><li data-md="">
          <p>Let <var>outputList</var> be the value of <var>output</var>’s [[SetData]] internal
   slot.</p>
         </li><li data-md="">
          <p>For each <var>entry</var> that is an element of <var>copiedList</var> that is not
   empty,</p>
          <ol>
           <li data-md="">
            <p>Let <var>outputEntry</var> be ? <a data-link-type="dfn" href="infrastructure.html#structuredclone" id="ref-for-structuredclone-8">StructuredClone</a>(<var>entry</var>, <var>targetRealm</var>, <var>memory</var>).</p>
           </li><li data-md="">
            <p>Add <var>outputEntry</var> as the last element of <var>outputList</var>.</p>
          </li></ol>
        </li></ol>
       </li><li data-md="">
        <p>Otherwise:</p>
        <ol>
         <li data-md="">
          <p>Let <var>enumerableKeys</var> be a new empty <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-list-and-record-specification-type">List</a>.</p>
         </li><li data-md="">
          <p>For each <var>key</var> in ! <var>input</var>.[[OwnPropertyKeys]]():</p>
          <ol>
           <li data-md="">
            <p>If <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a>(<var>key</var>) is String, then:</p>
            <ol>
             <li data-md="">
              <p>Let <var>inputDesc</var> be ! <var>input</var>.[[GetOwnProperty]](<var>key</var>).</p>
             </li><li data-md="">
              <p>If <var>inputDesc</var>.[[Enumerable]] is true, then add <var>key</var> as
   the last element of <var>enumerableKeys</var>.</p>
            </li></ol>
          </li></ol>
         </li><li data-md="">
          <p>For each <var>key</var> in <var>enumerableKeys</var>:</p>
          <ol>
           <li data-md="">
            <p>If ! <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-hasownproperty">HasOwnProperty</a>(<var>input</var>, <var>key</var>) is true, then:</p>
            <ol>
             <li data-md="">
              <p>Let <var>inputValue</var> be ? <var>input</var>.[[Get]](<var>key</var>, <var>input</var>).</p>
             </li><li data-md="">
              <p>Let <var>outputValue</var> be ? <a data-link-type="dfn" href="infrastructure.html#structuredclone" id="ref-for-structuredclone-9">StructuredClone</a>(<var>inputValue</var>, <var>targetRealm</var>, <var>memory</var>).</p>
             </li><li data-md="">
              <p>Perform ? <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-createdataproperty">CreateDataProperty</a>(<var>output</var>, <var>key</var>, <var>outputValue</var>).</p>
            </li></ol>
          </li></ol>
        </li></ol>
      </li></ol>
     </li><li data-md="">
      <p>Return <var>output</var>.</p>
    </li></ol>
    <p class="note" role="note"> In general implementations will need to use some kind of serialization and marshalling to
    implement the creation of objects in <var>targetRealm</var>, as <var>targetRealm</var> could be
    in a different <a data-link-type="dfn" href="webappapis.html#event-loop" id="ref-for-event-loop-5">event loop</a> and not easily accessible to the code that invokes <a data-link-type="dfn" href="infrastructure.html#structuredclonewithtransfer" id="ref-for-structuredclonewithtransfer-4">StructuredCloneWithTransfer</a> or <a data-link-type="dfn" href="infrastructure.html#structuredclone" id="ref-for-structuredclone-10">StructuredClone</a>. </p>
    <h4 class="heading settled" data-level="2.9.5" id="section-idistransferable"><span class="secno">2.9.5. </span><span class="content"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="istransferable">IsTransferable</dfn> ( <var>O</var> )</span><a class="self-link" href="infrastructure.html#section-idistransferable"></a></h4>
    <ol>
     <li data-md="">
      <p>Assert: <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a>(<var>O</var>) is Object.</p>
     </li><li data-md="">
      <p>If <var>O</var> has an [[ArrayBufferData]] internal slot, then:</p>
      <ol>
       <li data-md="">
        <p>If <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-isdetachedbuffer">IsDetachedBuffer</a>(<var>O</var>) is true, then return false.</p>
       </li><li data-md="">
        <p>Return true.</p>
      </li></ol>
     </li><li data-md="">
      <p>Otherwise, if <var>O</var> has a [[<a data-link-type="dfn" href="infrastructure.html#detached" id="ref-for-detached-3">Detached</a>]] internal slot, then:</p>
      <ol>
       <li data-md="">
        <p>If <var>O</var>’s [[<a data-link-type="dfn" href="infrastructure.html#detached" id="ref-for-detached-4">Detached</a>]] internal slot value is true, then return false.</p>
       </li><li data-md="">
        <p>Return true.</p>
      </li></ol>
     </li><li data-md="">
      <p>Return false.</p>
    </li></ol>
    <h4 class="heading settled" data-level="2.9.6" id="section-transferhelper"><span class="secno">2.9.6. </span><span class="content"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="transferhelper">TransferHelper</dfn> ( <var>input</var>, <var>targetRealm</var> )</span><a class="self-link" href="infrastructure.html#section-transferhelper"></a></h4>
    <ol>
     <li data-md="">
      <p>If <var>input</var> has an [[ArrayBufferData]] internal slot, then:</p>
      <ol>
       <li data-md="">
        <p>Let <var>output</var> be a new <code class="idl"><a data-link-type="idl" href="http://www.ecma-international.org/ecma-262/6.0/#sec-arraybuffer-constructor">ArrayBuffer</a></code> object in <var>targetRealm</var> whose
  [[ArrayBufferByteLength]] internal slot value is the [[ArrayBufferByteLength]] internal
  slot value of <var>input</var>, and whose [[ArrayBufferData]] internal slot value is the
  [[ArrayBufferData]] internal slot value of <var>input</var>.</p>
       </li><li data-md="">
        <p>Perform ! <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-detacharraybuffer">DetachArrayBuffer</a>(<var>input</var>).</p>
       </li><li data-md="">
        <p>Return <var>output</var>.</p>
      </li></ol>
     </li><li data-md="">
      <p>Return ? <var>input</var>.[[<a data-link-type="dfn" href="infrastructure.html#transfer" id="ref-for-transfer-3">Transfer</a>]](<var>targetRealm</var>).</p>
    </li></ol>
   </section></main>
  
<script src="js/fixup.js"></script>
  

<p class="prev_next">← <a href="introduction.html#introduction"><span class="secno">1</span> <span class="content">Introduction</span></a> — <a href="index.html#contents">Table of contents</a> — <a href="dom.html#dom"><span class="secno">3</span> <span class="content">Semantics, structure, and APIs of HTML documents</span></a> →</p></body></html>
